https://developer.mozilla.org/ru/doc...cts/Array/push
var arr = [];
class Art {
constructor() {
}
add(date, amount, currency, product) {
this.date = date;
this.amount = amount;
this.currency = currency;
this.product = product;
arr.push([date, amount, currency, product]);
}
list() {
return arr;
console.log(arr);
}
clear(date) {
arr.splice(1,1);
console.log(this.list());
}
total() {
return this.amount + this.currency;
}
}
const art = new Art();
art.add('2017-04-25', 2, 'USD', 'Jogurt');
art.add('2017-03-13', 5, 'EUR', 'Milk');
console.log(art.list());
console.log(art.total());