var scope="global";var a={ scope:"local", checkscope:function (){ var scope="local-1"; function f(){ // 1、return this.scope; //結果是"global" ,為什么不是local return scope; //結果是"local-1" } return f; }}為什么1 結果是"global" ,為什么不是local?作用域、作用域鏈和上下文怎么理解,感覺這些有點懵,求解答
關于閉包,作用域、作用域鏈和上下文
一只甜甜圈
2018-09-06 11:10:43