call apply bind

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

call apply bind

上一篇:网络大数据黑客揭秘,数据变相买卖,从手机到电脑!


下一篇:APP九宫格滑动解锁的处理