apply
use ES6
1 | Function.prototype.myCall = function(obj, ...args) { |
use eval
1 | Function.prototype.myCall = function(obj) { |
call
use ES6
1 | Function.prototype.myApply = function(obj, arr) { |
use eval
1 | Function.prototype.myApply = function(obj, arr) { |
bind
1 | Function.prototype.myBind = function(obj, ...arg1) { |
Update at 2020-04-02
call
1 | Function.prototype.myOwnCall = function(someOtherThis) { |
apply
1 | Function.prototype.myApply = function(someOtherThis, arr) { |
bind
1 | if(!Function.prototype.bind) { |