title: Replace all whitespace characters
body: <p>I want to replace all occurrences of white space characters (space, tab, newline) in JavaScript.<br>
  How to do so?  </p>
  
  <p>I tried:</p>
  
  <pre><code>str.replace(/ /gi, "X")
  </code></pre>