mqyqingfeng / Blog

冴羽写博客的地方,预计写四个系列:JavaScript深入系列、JavaScript专题系列、ES6系列、React系列。
30.53k stars 4.7k forks source link

为啥每次都要创建一个 Child函数来new 子类?现在不都是 const p1 = new Person(); const p2 = new Person()吗 #325

Open panqingjie00 opened 8 months ago

panqingjie00 commented 8 months ago

现在js、es 的继承不都是,const p1 = new Person(); const p2 = new Person()这样写吗? 为啥这篇教程里全都加了一个 function Child () { },求解