Function.prototype.mycall = function(context = window,...args){
context.fn = this
let result = context.fn(...args)
delete context.fn
return result
}
Function.prototype.myapply = function(context = window,args){
context = context
context.fn = this
let result = context.fn(...args)
delete context.fn
return result
}
Function.prototype.mybind = function(context,...args){
var self = this
var fbound = function(...bindArgs){
return self.apply(
this instanceof self ? this : context,
args.concat(bindArgss)
)
}
fbound.prototype = Object.create(self.prototype);
return fbound
}