var name = 'j o h n';
arr = name.split(/\s/ig).join('');
I'm wanting to remove the spaces and the letter 'n' from the end.
I've tried /\sn/ig
or /\s[n]/ig
but i can not seem to both remove spaces
and the letter that I want. I've search the web to see how to do this but
haven't really found something to clearly explain how to put in multiple put in multiple expressions into the pattern.
Thanks!