title: Why does my javascript function return true when it should return false
body: <p>I cannot figure this one out.</p>
  
  <p>string s has the value of "john". </p>
  
  <p>my function is supposed to return whether the number of occurrences of mike and john in s are the same.</p>
  
  <p>It correctly prints the count of mike to be 0.
  It correctly prints the count of john to be 1.</p>
  
  <p>And yet, after checking for equality between the two, it returns true! why?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function solve(s) {
    // Write your code here
    var countm = (s.match(/mike/g) || []).length;
    var countj = (s.match(/john/g) || []).length;
    console.log(countm);
    console.log(countj);
  
    if (countm == countj) {
      return Boolean("true");
    } else {
      return Boolean("false");
    }
  
  }
  console.log(solve('john'));</code></pre>
  </div>
  </div>
  </p>