Is checking a string against a number good style?
<p>Which one of these to JS snippets are better in terms of style?</p>

<pre><code>var answer = Number(prompt('What is the value of 2 + 2?'));

if (answer === 4) {
    // do something
}
</code></pre>

<p>vs.</p>

<pre><code>var answer = prompt('What is the value of 2 + 2?');

if (answer == 4) {
    // do something
}
</code></pre>

<p>I'd say the first one is better because it is more explicit (and no type coercion will happen).</p>
