title: Counting vowels in javascript
body: <p>I use this code to search and count vowels in the string, </p>
  
  <pre><code>a = "run forest, run";
  a = a.split(" ");
  var syl = 0;
  for (var i = 0; i &lt; a.length - 1; i++) {
      for (var i2 = 0; i2 &lt; a[i].length - 1; i2++) {
          if ('aouie'.search(a[i][i2]) &gt; -1) {
              syl++;
          }
      }
  }
  
  alert(syl + " vowels")
  </code></pre>
  
  <p>Obviously it should alert up 4 vowels, but it returns 3.
  What's wrong and how you can simplify it?</p>