让我们假设这个 javascript 代码
function a (b,c,d) {log(this); return b+c+d;}
a(1,2,3); // logs [Object Window], returns 6
bound = a.bind("hello", 5,6);
bound(7); // logs "hello", returns 18
现在给定函数bound
(例如作为回调),有没有办法检索绑定的上下文 - 即 "hello", 5, 6 ?
让我们假设这个 javascript 代码
function a (b,c,d) {log(this); return b+c+d;}
a(1,2,3); // logs [Object Window], returns 6
bound = a.bind("hello", 5,6);
bound(7); // logs "hello", returns 18
现在给定函数bound
(例如作为回调),有没有办法检索绑定的上下文 - 即 "hello", 5, 6 ?