class Basket {
constructor(order, price, count) {
this.order = order;
this.price = price;
this.count = count;
}
static totalPrice() {
let total = this.price * this.count;
console.log('Вы должны заплатить: ' + total + ' рублей');
}
}
new Basket(1, 100, 5).totalPrice();
Вот ошибка:
class Basket {
constructor(order, price, count) {
this.order = order;
this.price = price;
this.count = count;
}
totalPrice() {
let total = this.price * this.count;
console.log('Вы должны заплатить: ' + total + ' рублей');
}
}
new Basket(1, 100, 5).totalPrice();
Собственно зачем вам там статик?
Апостиль в Лос-Анджелесе без лишних нервов и бумажной волокиты
Основные этапы разработки сайта для стоматологической клиники
Продвижение своими сайтами как стратегия роста и независимости