js trim out input white space

JavaScript
const removeSpaces = str => str.replace(/\s/g, '');

// Example
removeSpaces('hel lo wor ld');      // 'helloworld'
Source

Also in JavaScript: