/ Published in: JavaScript

Checking for undefined
in JavaScript is weird (the variable can be redefined), so I made a function to do it. This stuff (and others) is also in my JSTypes type-checking library.
Expand |
Embed | Plain Text
// As a function Evan.isUndefined = function(u) { return typeof u === 'undefined'; }; // In an "if" if (typeof foo === 'undefined') { // ... }
You need to login to post a comment.