So how do I push to the CONSUPTION array? Using THIS is not working and ia have no clue on how to make the ORDER work.
const createMenu = (menu) => ({
fetchMenu: () => menu,
consumption: [1,2],
order: (string) => {
this.consumption.push(string);
},
pay: () => {
let cont = 0
const cardapio = { ...menu.food, ...menu.drink}
for (let itens of this.consumption){
cont += cardapio[itens];
};
return cont;
},
});