闭包
能够读取其他函数内部变量的函数(定义在一个函数内的函数)
1 var name = "The Window"; 2 3 var object = { 4 name : "My Object", 5 6 getNameFunc : function(){ 7 return this.name; 8 // return function(){ 9 // return this.name; 10 // }; 11 12 } 13 14 }; 15 alert(object.getNameFunc());