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