R
Ray
Hello,
I've been running my scripts through Douglas Crockford's JSLint. I
notice that it keeps complaining when I do this:
if (da != null) {
it says "Use !== to compare with null".
It does the same for comparison with undefined.
It also complains when I check whether soemthign is true or not:
Use '===' to compare with 'true'.
My question is, what is the reason behind it? Won't != and == work
equally well in the cases above?
Thanks!
Ray
I've been running my scripts through Douglas Crockford's JSLint. I
notice that it keeps complaining when I do this:
if (da != null) {
it says "Use !== to compare with null".
It does the same for comparison with undefined.
It also complains when I check whether soemthign is true or not:
Use '===' to compare with 'true'.
My question is, what is the reason behind it? Won't != and == work
equally well in the cases above?
Thanks!
Ray