Simple question, Provided that 'dish' is a standard object from the same type. Why is the push not possible??
class DinnerModel {
constructor() {
this.menu = new Array();
this.dishes = dishesConst;
this.guests = this.setNumberOfGuests(1);
}
addDishToMenu(dish) {
menu.push(dish);
}
I get the error message:
ReferenceError: menu is not defined
at DinnerModel.addDishToMenu (src/model/dinnerModel.js:76:5)
at Context.<anonymous> (src/model/dinnerModel.test.js:204:15)
menu!==this.menu