I would like to remove every non alphanumeric character from a word, however I rather keep whitespaces. Is it able to somehow join these two cases together?
const word = 'dwa$-I| awd#4'.replace(/\W/g, '');
console.log(word); // whitespace removed =((