Y
Hacker News
new
|
ask
|
show
|
jobs
by
phpnode
4370 days ago
the other benefit is that `void 0` cannot be overwritten in sloppy mode, whereas you can do something crazy like this:
undefined = 'lol';
1 comments
evilpie
4370 days ago
No you can't. You can do something like function(undefined) {}, but the global 'undefined' is non-writable and non-configurable.
link
ahoge
4370 days ago
That's an ES5 change. With ES3, you can overwrite NaN, Infinity, and undefined.
link
LunaSea
4369 days ago
Only in strict mode I though no ?
link
ahoge
4369 days ago
Generally. Technically, it's a "breaking change".
As you can imagine, this didn't actually affect anyone.
link