node js string remove space from string 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'