call
Function.prototype.CALL = function(){
let args = Array.from(arguments);
let obj = args.splice(0,1)[0];
obj.fn = this; var result = obj.fn(...args);
return result
delete result
}
const obj = {
b:'2324',
f:234
}
function objfn(){
console.log(this);
}
objfn.CALL(obj,2,3,5);
Function.prototype.apply = function(context,args){ context.fn = this; var result = obj.fn(args); return result; delete result;}const obj = { b:'2324', f:234}function objfn(){ console.log(this);}objfn.apply(obj,[2,3,5]);
bind
Function.prototype.bind= function(context,args){ const _this = this;