function foo (el) {
console.log(el, this.id);
}
var obj = {
id: 'aaa'
};
[2,6,3].forEach(foo, obj);

2aaa 6aaa 3aaa

通过call()、apply()进行绑定

相关文章: