Hello,
I am working on this Java Script project by the name of Meal Maker and I am having some difficult as I am unable to see my error.
The console keeps showing up as unexpected token.
Could someone please tell me what I am doing wrong.
This is the code that I have written up to now :
const menu = {
_courses: {
appetizers: ,
mains: ,
dessers: ,
},
get appetizers () {
return this._courses.appetizers;
},
get mains () {
return this._courses.mains;
},
get desserts () {
return this._courses.desserts;
},
set appetizers(appetizers) {
this.courses.appetizers = appetizers;
},
set mains(mains) {
this.courses.mains = mains;
},
set desserts(desserts) {
this.courses.desserts = desserts;
}, get courses() {
return {
appetizers: this.appetizers,
mains: this.mains,
desserts: this.desserts
},
.addDishToCourse(courseName, dishName, dishPrice) {
const dish = {
name: dishName,
price: dishPrice
} return this._courses[courseName].push(dish);
};
.getRandomDishFromCourse(courseName) {
const dishes = this._courses[courseName];
const randomIndex = Math.floor(Math.random()* dishes.length);
return dishes[randomIndex];
},
.generateRandomMeal = () => {
const appetizer = .getRandomDishFromCourse(appetizers);
const main = .getRandomDishFromCourse(main);
const dessert = .getRandomDishFromCourse(dessert);
const totalPrice = appetizer.price + main.price + dessert.price;
return Your meal is ${appetizer.name}, ${main.name}, ${dessert.main} and the total price price of meal is ${totalPrice}
;
}
};
};
menu.addDishtoCourse