What does “!” operator mean in javascript when it is used with a non-boolean variable?
Any falsy value will satisfy the if(!insert_variable_here) condition, including: false null undefined The empty string ” The number 0 NaN If 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’); … Read more