title: Variables comparison
body: <p>I have this simple problem with Javascript where I want to compare two variables, but somehow it doesn't work correctly. I even checked that the types of variables are the same. Please help.
  Specifically, I get alerts for numbers, and I even get the alert for current counter is 5 total is 5, although I would expect it to enter the "then".</p>
  
  <pre><code>function fun(idCount, finalCallback) {
  this.idCount = parseInt(idCount);
  var counter = 0;
  var strings = {};
  this.register = function(str, id) {
      counter++;
      strings[parseInt(id)] = str;
  
      if(counter == this.idCount) {
          alert("Going to override");
          //blabla
      } else {
          alert("Current counter is: " + counter + " Total " + idCount + ". Types: " + typeof counter + " and " + typeof idCount);
      }
  }
  }
  </code></pre>