Javascript - How to remove all extra spacing between words
<p>How can I remove all extra space between words in a string literal?</p>

<pre><code>"some    value"
</code></pre>

<p>Should become</p>

<pre><code>"some value"
</code></pre>

<p>Also, </p>

<pre><code>"    This    should  become   something          else   too . "
</code></pre>

<p>Becomes</p>

<pre><code>"This should become something else too ."
</code></pre>

<p>Do not worry about moving the <code>.</code>.  Just as above is fine.  I know I can use <code>$.trim(str)</code> to achieve the trailing/ending space removal.  But, I'm not sure how to do the 1 space between words trick.</p>
