how to remove all whitespace from a string js code example Example: remove all spaces from a string javascript .replace(/ /g,'')