Call,Apply,Bind实现
1.bind
1 | Function.prototype.mybind = function(thisArg) { |
test
1 | const bar = function() { |
2.call
1 | Function.prototype.mycall = function(thisArg) { |
3.apply
1 | Function.prototype.myapply = function(thisArg) { |
welcome to my Blog!
1 | Function.prototype.mybind = function(thisArg) { |
test
1 | const bar = function() { |
1 | Function.prototype.mycall = function(thisArg) { |
1 | Function.prototype.myapply = function(thisArg) { |