Javascript validation, where string is compiled of only any number of spaces
<p>I am looking for a function that will return true / false if the string in question is complied of any number of spaces. The common method of doing this is <code>if (string == " ")</code> but this only works for one space. I need a function that would resolve any number of spaces to a return statement.</p>

<p>example </p>

<pre><code>if (string == " ")
if (string == "  ")
if (string == "   ")
if (string == "    ")
if (string == "     ")
</code></pre>

<p>What is the best way to do this?</p>
