I'm trying to remove any non alphanumeric characters ANY white spaces from a string.
Currently I have a two step solution and would like to make it in to one.
var name_parsed = name.replace(/[^0-9a-zA-Z ]/g, ''); // Bacon, Juice | 234
name_parsed = name_parsed.replace(/ /g,'')
console.log(name_parsed); //BaconJuice234
Could someone let me know how to achieve above in one execution and not two?
replace(/\W+/g, '')\wincludes_as well.