News for hackers. Stuff that matters.
Re:Show HN: I built an extension of JavaScript in a day by tshadwell on Saturday August 16, 2014 @03:53PM (#8187325)
By the way, `typeof X === 'undefined'` doesn't need to be used for variable names that exist such as arguments, you can use X == undefined without opportunity for failure.
Re:Show HN: I built an extension of JavaScript in a day by woogley on Saturday August 16, 2014 @05:34PM (#8187659)
Technically, all edge cases considered, `typeof` is the only fool-proof check, since you can't override the string constant `'undefined'` but the `undefined` identifier is fair game.

Here is one such edge case:

    (function () {
      var undefined = true;
      return (function foo(x) {
        return x === undefined;
      }());
    }()); // false
Language pedantry aside, browsers these days will freeze `window.undefined` so you'd have to shoot yourself in your own scope ;)
Re:Show HN: I built an extension of JavaScript in a day by tshadwell on Thursday August 21, 2014 @11:15AM (#8207721)
if you're that determined to shoot yourself in the foot you might as well rebind valueOf
Re:Show HN: I built an extension of JavaScript in a day by chmod775 on Saturday August 16, 2014 @03:55PM (#8187337)
Thank you! I'll fix it asap.