js闭包

来源:互联网 发布:nyaa的域名 编辑:程序博客网 时间:2024/05/17 08:21

http://segmentfault.com/q/1010000000095895


http://www.ibm.com/developerworks/cn/web/1207_wangqf_jsthis/index.html   -----深入浅出js的 this,js的门槛。


http://yehudakatz.com/2011/08/11/understanding-javascript-function-invocation-and-this/    --经典例子  然后结合bind来看


看this到底是指向什么。this只能表示当前,还是指的是全局对象?  js全局对象是window



注意:Yehuda Katz 强调了函数调用时 this 绑定的过程,不管函数以何种方式调用,均需完成这一绑定过程,不同的是,作为函数调用时,this 绑定到全局对象;作为方法调用时,this 绑定到该方法所属的对象。