Whilst what Xen says will work, it's possibly worth pointing out there is also a "===" operator.
The difference being that "==" will do type conversion to encourage a match, whilst "===" is stricter and requires same type too.
For example:
code:
var a = 0;
var b = '0';
document.write(a==b);
document.write('\n');
document.write(a===b);
Some people argue you should always do === (unless you explicitly need == instead), though I'm not sure how much it matters (possibly a bit slower for non-matches, but most likely not worth worrying about).