Я пытаюсь создать компонент js, который рассчитывает стоимость хранилища.Это включает 8-недельное предложение со скидкой 50%, а затем цена повышается до 100% в течение оставшихся 44 недель.
Я получаю «Uncaught ReferenceError: Недопустимая левая сторона в назначении».Может кто-нибудь помочь определить, где я иду не так?
Спасибо!
class Company {
constructor(companyName) {
this._companyName = companyName;
this._location = location;
}
get companyName() {
return this._companyName;
}
get location() {
return this._location;
}
}
class EightWeeks extends Company {
constructor(week, year, month) {
super(companyName);
this._week = week;
this._year = year;
this._month = month;
}
get week() {
return this._week;
}
get year() {
const yearlyCost = (this._week * 44) += (this._week * 8);
return this.yearlyCost;
}
get month() {
return this._year / 12;
}
}
const accessHornsey = new EightWeeks ('17.77', '', '');
console.log(EightWeeks);