diff --git a/src/shared/md/2010-02-15-undefined-is-mutable.md b/src/shared/md/2010-02-15-undefined-is-mutable.md index 19baacf..dc853b7 100644 --- a/src/shared/md/2010-02-15-undefined-is-mutable.md +++ b/src/shared/md/2010-02-15-undefined-is-mutable.md @@ -14,4 +14,15 @@ Due to the mutability of undefined, it is generally a better idea to check for u typeof a.b == 'undefined'; // always true ``` -– [@mathias](http://mathiasbynens.be/) \ No newline at end of file +– [@mathias](http://mathiasbynens.be/) + +That is no longer the case in [ECMAScript 5](http://ecma-international.org/ecma-262/5.1/#sec-15.1.1.3) + +In ECMAScript 3, a [trick you can use](http://www.2ality.com/2011/05/void-operator.html) is comparing to `void 0` because the **void** expression always evaluates to **undefined**: + +``` + var a = {}; + a.b === void 0; // true +``` + +– [@specious](https://github.com/specious) \ No newline at end of file