function sai(){
console.log(this.x)
}
var a = {
x: 1
}
var b = {
x: 2
}
sai.call(a)//1
sai.call(b)//2
sai.call(a).call(b)//1 Uncaught TypeError: Cannot read property 'call' of undefined at <anonymous>
sai.apply(b).apply(a)//2 Uncaught TypeError: Cannot read property 'apply' of undefined at <anonymous>
sai.bind(a).call(b)// 1
相关文章
- 01-14bootstrapValidator Maximum call stack size exceeded
- 01-14call、apply、bind的用法
- 01-14call-apply-bind区别
- 01-14利用Apply的参数数组化来提高代码的优雅性,及高效性
- 01-14~/microwindows-0.89pre8/src/bin$ ./nano-X error:Cannot bind to named socket
- 01-14__init__、__new__、__call__ 方法
- 01-14bind,apply,call使用和区别
- 01-14call bind applay 详解
- 01-14v-bind v-model
- 01-14ipv4、ipv6的socket同时监听“bind: Address already in use”的解决方法