js中改变this指向(Call、apply、bind)
Call方法 call方法可以改变this指向,并且会直接调用 fun.call(this,arg1,arg2) 利用call方法可以实现构造函数之前的属性继承function Father(name,age){ this.name = name ; this.age = age ;}function Son(name,age,addr) { this.addr = addr ; Father.call(thi...
原创
2021-08-03 17:51:58 ·
271 阅读 ·
0 评论