第一种: return出的函数的this指向为window,因此输出为The Window
第二种:that为当前的object,因此输出为 My Object
转自:https://www.ruanyifeng.com/blog/2009/08/learning_javascript_closures.html
ps:阮一峰写的通俗易懂,建议观看。我只是博客的搬运工。
第一种: return出的函数的this指向为window,因此输出为The Window
第二种:that为当前的object,因此输出为 My Object
转自:https://www.ruanyifeng.com/blog/2009/08/learning_javascript_closures.html
ps:阮一峰写的通俗易懂,建议观看。我只是博客的搬运工。