Best way to check that a variable is only an integer in JavaScript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3885817/how-to-check-if-a-number-is-float-or-integer">How to check if a number is float or integer?</a>  </p>
</blockquote>



<p>What is the bet way to check that a variable is an integer?</p>

<p>in Python you can do:</p>

<pre><code> if type(x) == int
</code></pre>

<p>Is there an equally elegant equivalent in JS?</p>
