title: Counting number of vowels in a string with JavaScript
body: <p>I'm using basic JavaScript to count the number of vowels in a string.  The below code works but I would like to have it cleaned up a bit.  Would using <code>.includes()</code> help at all considering it is a string?  I would like to use something like <code>string.includes("a", "e", "i", "o", "u")</code> if at all possible to clean up the conditional statement.  Also, is it needed to convert the input into a string?</p>
  
  <pre><code>function getVowels(str) {
    var vowelsCount = 0;
  
    //turn the input into a string
    var string = str.toString();
  
    //loop through the string
    for (var i = 0; i &lt;= string.length - 1; i++) {
  
    //if a vowel, add to vowel count
      if (string.charAt(i) == "a" || string.charAt(i) == "e" || string.charAt(i) == "i" || string.charAt(i) == "o" || string.charAt(i) == "u") {
        vowelsCount += 1;
      }
    }
    return vowelsCount;
  }
  </code></pre>