标签:ons name prope class cti code ret OLE bind
let obj={ name:‘金毛‘ } function test(){ console.log(123,this) } test.call(obj,‘123‘) //手写 Function.prototype.myCall=function(thisObj,arr){ let Fn = this let s =Symbol(‘func‘) let s2 =Symbol(‘func‘) let del =Object.getOwnPropertySymbols(thisObj) delete thisObj[del[0]] thisObj[s]=Fn thisObj[s](arr) }//手写call
let obj={ name:‘金毛‘ } function test(){ console.log(123,this) } test.call(obj,‘123‘) //手写 Function.prototype.myCall=function(thisObj,arr){ let Fn = this return function (){ let s =Symbol(‘func‘) let s2 =Symbol(‘func‘) let del =Object.getOwnPropertySymbols(thisObj) delete thisObj[del[0]] thisObj[s]=Fn thisObj[s](arr) } }//bind
标签:ons name prope class cti code ret OLE bind
原文地址:https://www.cnblogs.com/menggege/p/14129709.html