function Foo(){ /*some attributes and methods here*/ } function Bar(){}
比如声明了Foo之后,想让Bar继承它,好像有两种方法: 1. Bar.prototype = new Foo(); 2. Bar.prototype = Foo.prototype; 这两种方法是完全等价的吗?还是有啥细微差别?
收起
一个是实例化,一个是静态类~
报告相同问题?