title: Find number of spaces in a string using JavaScript
body: <p>How can I find out number of spaces in a string using JavaScript only?</p>
  
  <pre><code>"abc def rr tt" // should return 3
  "34 45n v" // should return 2
  </code></pre>