function Car(model, color, power){
this.model = model;
this.color = color;
this.power = power;
this.is_working = true;
this.sound = function(){
console.log("Vrummm!");
};
}
function Car_optionals(){
this.turbo_boost = true;
this.extra_horsepower = 20;
this.name_tag = "Badass";
}
Car.prototype = new Car_optionals();
var Audi = {};
Audi.prototype = new Car();
console.log(Audi.is_working);
그래서이 클래스에도 Car 및 Car_optionals 클래스가 있으며, 새롭게 작성된 객체 인 Audi가 Car 및 Car_optionals 클래스에서 소유권을 상속 받기를 원합니다. 객체 리터럴 내에서 소유권 및 메서드를 상속하는 것이 가능합니까?객체 리터럴 내 상속
잘 전화를() 함수는 나를 위해 트릭을 할 것입니다. 그게 내가 찾고 있던거야. 고마워! –