What does this JS do?
<pre><code>var passwordArray = pwd.replace(/\s+/g, '').split(/\s*/);
</code></pre>

<p>I found the above line of code is a rather poorly documented JavaScript file, and I don't know exactly what it does. I think it splits a string into an array of characters, similar to PHP's str_split. Am I correct, and if so, is there a better way of doing this?</p>
