Then why are you checking for null? That's the point.
again, to know if a variable is null or undefined since I threat both
values as one, I've never had a valid reason for distinguish between
null and undefined.
Your code is
ambiguous and the next person reading it can't be expected to read your
mind, so will have to investigate to determine exactly what you meant
(or did not mean).
since you'll never find a === undefined in my code, I wonder wchih
part is ambiguous...
typo, I meant every time I have to specify via *comment* that I meant
it ...
That's not the point. I know what it means, but I can't guess what
_you_ thought it meant. If I find, after investigation, that you were
using == null when === undefined would have sufficed
there we are ...
=== undefined is a disaster prone approach. Nobody should rely in a
global scope variable as undefined is to understand if a variable is
undefined.
typeof varname === "undefined" is the only safe way, OR we can simply
test against == null if we are NOT interested into undefined values.
You have got the wrong end of the stick (again).
while apparently You have not get what is the problem and why ...
Again, and for the last time:
1 - there is no coercion against "== null" , only a case specified by
specs
2 - "== null" is true only with null or undefined, the error showed
by JSLint and the privded reason (coercion) *is* *wrong*
3 - I do believe undefined is a "pointless value" on daily basis
code, I rarely need to know if a value is exactly undefined ... the
most common case is *double* check against null and typeof "undefined"
indeed and this is a waste of time, a waste of bytes, a waste of
performances ... but surely you decide how to code in a "non ambiguous
way" for a case that has nothing ambiguous for its purpose, imho
Regards