还有一种继承方式:
function Person() { this.x = 1; }
function Student() { Person.apply(this); this.y = 2; }
var s = new Student();
s.x;
s.y;
function Person() { this.x = 1; }
function Student() { Person.apply(this); this.y = 2; }
var s = new Student();
s.x;
s.y;
2017-02-01