var s = "Hello! I'm billy! what's up?"; var result = s.split(" ").join(); console.log(result); Got this result
Hello!,I'm,,billy!,what's,,,,up? How can i get rid of this annoying extra spaces between string? So it might look like this.
Hello!,I'm,billy!,what's,up?