title: For loop not looping and can't figure out why
body: <p>So I'm doing some programming exercises and I got stuck on this one.  It's a simple search for the <code>E</code>'s in a phrase . I don't get why the <code>for</code> dosen't loop, and the result just goes to the confirm that it did not find any <code>E</code>'s in my phrase. Can anyone see anything wrong with my <code>for</code> loop?</p>
  
  <pre><code>/*
   * Function that counts E's in a user-enter'd phrase
   **/
  function countE() {
    var phrase = prompt("Which phrase would you lke to examine ?");
    if( typeof(phrase) != "string" ) {
      alert("That is not a valid entry!");
      return false;
    }  else {
      for(var eCount = 0; eCount &lt; phrase.length; eCount++) {
        if( phrase.charAt(eCount) == 'E' || phrase.charAt(eCount) == 'e' ) {
          alert("There are " + eCount + " E's in \"" + phrase + "\".");
          return true;
        } else {
          var report = confirm("I did not find any E's in your phrase. Would you like to try again?");
          if(report == true) {
            return countE();
          } else {
            alert("Ok maybe next time!");
            return false;
          }
        }
      }
    }
  }
  
  countE();
  </code></pre>