實例
Object.prototype.x = 'outer';
(function(){
const a = {};
(function foo(){
console.log(a.x);
})();
})();
注:輸出結果爲outer。
避免
Object.prototype.x = 'outer';
(function(){
const a = Object.create(null);
(function foo(){
console.log(a.x);
})();
})();
注:輸出結果就是undefined。