Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
kevincennis
· 11y ago · 0 comments
In ES5+, the global `undefined` is immutable, so it should be pretty safe unless someone declared a local `undefined` var in an outer scope.
Comments
[–]
arnehormann
11y ago
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.