js 实现 类继承 通过super 给父级传参的效果
摘要:通过es5 实现 类继承 通过super 给父级传参的效果 先看看 原型继承 function es5parent(name, age) { this.name = name; this.age = age; } es5parent.prototype.say = function() { cons
阅读全文
posted @
2023-03-31 11:23
浅唱年华1920
阅读(122)
推荐(0) 编辑
手写 call、applay、bind
摘要:call Function.prototype.mycall = function(context, ...args) { if (this Function.prototype) { return undefined; } context = context || window; const fn
阅读全文
posted @
2023-03-30 16:19
浅唱年华1920
阅读(23)
推荐(0) 编辑