3 ms·
Nice guide & nicely written! This example snippet actually generates a Javascript error (at least, in IE9): var foo = null; // foo is null, but bar
by zmmmmm 16y ago
Nice guide & nicely written!
This example snippet actually generates a Javascript error (at least, in IE9):
var foo = null;
// foo is null, but bar is undefined as it has not been declared
if (foo == null && bar == null) {
// still got in here
}
It will work if bar is declared but has value undefined, but not if bar is completely undeclared as shown.
- ricardobeat 16y agocommon error. typeof bar === 'undefined'