摘要: 请见如下一个闭包示例:color = "red";var obj = { color: "blue", getColor: function () { function displayColor() { return this.color; ... 阅读全文
posted @ 2014-09-21 02:19 Tong Zeng 阅读(1410) 评论(0) 推荐(0) 编辑
摘要: 示例1:function makeCounter() { var i = 0; console.log( ++i );}var counter = makeCounter(); // 输出: 1counter(); //TypeError: undefined is not a fun... 阅读全文
posted @ 2014-09-21 00:18 Tong Zeng 阅读(228) 评论(0) 推荐(0) 编辑