var temp = NaN;
var wtf = temp[0];
console.log(wtf); //undefined
What else would you expect it to be? JavaScript in general guards against throwing errors as much as possible... I'd much rather see this behavior in practice than having to put extra try/catch blocks everywhere... Not to mention what this would do to async code.
Comments