最佳答案
thisArg
指应调用回调的上下文,
基本上就是this
指内部回调。例如:
var myObject = { name: 'myObject' };
[1,2].forEach(function(item) {
console.log(item); // 1, 2
console.log(this === myObject); // true
}, myObject)
关于javascript - .forEach 中 thisArg 的用途是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34556558/