How to replace or remove all spaces from a string in JavaScript?

How to replace or remove all spaces from a string in JavaScript?