title: Why does string to number comparison work in Javascript
body: <p>I am trying to compare a value coming from a HTML text field with integers. And it works as expected.
  Condition is - </p>
  
  <pre><code>x &gt;= 1 &amp;&amp; x &lt;= 999;
  </code></pre>
  
  <p>Where <code>x</code> is the value of text field. Condition returns <code>true</code> whenever value is between 1-999 (inclusive), else <code>false</code>.
  Problem is, that the value coming from the text field is of string type and I'm comparing it with integer types. Is it okay to have this comparison like this or should I use parseInt() to convert <code>x</code> to integer ?</p>