title: toString or to parseInt javascript
body: <p>So today I encountered this scenario. I had an integer and a string I needed to compare. In order to compare the two I would either have to toString() the integer, or parse the string to an int. </p>
  
  <p>Here's my question, which one should I go for, is there any difference in performance for the two? (even if it is minimal) Is there a rule of thumb?</p>
  
  <p>Here's a code example:</p>
  
  <pre><code>var intI = 1;
  var stringS = '1';
  
  if (intI.toString() == stringS)
  console.log('are equal');
  
  //Or
  if (intI == parseInt(stringS))
  console.log('are equal');
  </code></pre>
  
  <p>It would be best if I could declare the Integer as a string I know (as it is not used for calculations). But it is used everywhere on the site.</p>