JavaScript继承是采用原型链进行继承,
function Box() {
}
function Desk() {
}
Desk.prototype = new Box() //通过原型链继承
var desk = new Desk();
JavaScript继承是采用原型链进行继承,
function Box() {
}
function Desk() {
}
Desk.prototype = new Box() //通过原型链继承
var desk = new Desk();