remove empty space in javascript code example
Example 1: js remove space from string
string.split(" ").join("")
Example 2: javascript remove space from string
const removeSpaces = str => str.replace(/\s/g, '');
// Example
removeSpaces('hel lo wor ld'); // 'helloworld'