Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In ES5+, the global `undefined` is immutable, so it should be pretty safe unless someone declared a local `undefined` var in an outer scope.


I use "var undef;" at the top of a function and never set it to a value. Comparison with === is the same as with undefined. And it's nice for minification.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: