const removeSpaces = (str) => str.replace(/\s/g, '');
const removeSpaces = (str: string): string => str.replace(/\s/g, '');
removeSpaces('hel lo wor ld'); // 'helloworld'