title: Remove all multiple spaces in Javascript and replace with single space
body: <p>How can I automatically replace all instances of multiple spaces, with a single space, in Javascript?</p>
  
  <p>I've tried chaining some <code>s.replace</code> but this doesn't seem optimal.</p>
  
  <p>I'm using jQuery as well, in case it's a builtin functionality.</p>