title: In JavaScript/regex, how do you remove double spaces inside a string?
body: <p>If I have a string with multiple spaces between words:</p>
  
  <pre class="lang-none prettyprint-override"><code>Be an      excellent     person
  </code></pre>
  
  <p>using JavaScript/regex, how do I remove extraneous internal spaces so that it becomes:</p>
  
  <pre class="lang-none prettyprint-override"><code>Be an excellent person
  </code></pre>