function Owner() {
this.addCar = function(car) {
this.car = car;
};
this.setBalance = function(balance) {
this.balance = balance;
};
this.setOwnerId = function(id) {
this.id = id;
};
}
function Company(name = 'Name uncknown', address = 'Address unknown', car = 'The car is missing') {
this.name = name;
this.address = address;
this.car = car;
}
Company.prototype = new Owner();
НЕ МОГУ ПОНЯТЬ(( Как переписать код, так, чтобы при вызове setCar из функции-конструктора, в
this.car записывался массив объектов.....при этом при каждом вызове addCar - пушился новый объект в существующий массив