call
1 | Function.prototype.myCall = function(context) { |
apply
1 | Function.prototype.myApply = function(context) { |
bind
1 | Function.prototype.myBind = function(context) { |
new
1 | // 使用__proto__ |
Object.create
1 | const myCreate = function(obj) { |
instanceof
1 | // instanceof实现原理,本质是遍历原型链 |