对js中prototype的理解

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

posted @ 2014-09-23 17:34  会飞的鱼儿游  阅读(116)  评论(0编辑  收藏  举报