javascript原型链

JavaScript继承是采用原型链进行继承,

function Box() {

}

function Desk() {

}

Desk.prototype = new Box() //通过原型链继承

var desk = new Desk();

你可能感兴趣的:(javascript原型链)