对js中prototype的理解

一直不理解child.prototype = new Parent()和child.prototype =Parent.prototype的区别,到现在为止,我觉得它俩最大的区别就是:前者共享构造器里的属性,后者不会共享构造器里的属性。不过都是会继承Parent里的方法。

原文地址:https://www.cnblogs.com/freefish12/p/3988927.html