title: Split a string using whitespace in Javascript?
body: <p>I need a tokenizer that given a string with arbitrary white-space among words will create an array of words without empty sub-strings.</p>
  
  <p>For example, given a string:</p>
  
  <pre><code>" I dont know what you mean by glory Alice said."
  </code></pre>
  
  <p>I use:</p>
  
  <pre><code>str2.split(" ")
  </code></pre>
  
  <p>This also returns empty sub-strings:</p>
  
  <pre><code>["", "I", "dont", "know", "what", "you", "mean", "by", "glory", "", "Alice", "said."]
  </code></pre>
  
  <p>How to filter out empty strings from an array?</p>