While reading through javascript codes I\'ve been seeing the ! operator used for non boolean variables. Here is an example of code not used in.
Any falsy value will satisfy the if(!insert_variable_here) condition, including:
falsenullundefined''0NaNIf callback return evaluates any of those values, the condition will be satisfied.
Even though null != false, the following will give you an alert:
x = null;
if(!x) {
alert('"!null" does evaluate to true');
}
Regardless of whether or not null != false makes sense to you or anyone else, the point is that in JavaScript null is a falsy value, and thus a value that would satisfy the condition in my first bit of code listed above. This, it seems, is the question you have asked--not, rather, if null should or should not == false.