str.removeWhitespaces()
// 🔸 str.removeWhitespaces()
String.prototype.removeWhitespaces = function() {
return this.replace(/\s+/g, '');
};// multi-line string
let str = `
as void async while
`;
str.removeWhitespaces() // "asvoidasyncwhile"Last updated