Meal Maker Project Help

I need help on the meal maker project. I’m getting the “unexpected token return” error on my concatenation at the end of the code. What am i doing wrong?

here’s my code: Meal Maker Code

thanks in advance for any input :slight_smile:

const totalPrice = 
appetizer.price + main.price + dessert.price, //you have a comma instead of a ;
return meal; //instead of console.log(meal)

Then you get a TypeError, cannot read property ‘price’ of undefined.

To fix this:

getRandomDishFromCourse (courseName) {
  const dishes = this._courses[courseName];
  const randomIndex = Math.floor(Math.random() * dishes.length);
  return dishes[randomIndex] //you have to return the random dish, otherwise it won't work properly
const dish = {
    name: courseName,//change this to dishName or it will print 'Your meal is appetizers, mains, desserts...
    price: dishPrice,

Other than that you’re good!
I suggest downloading a code editor, (I recommend Visual Studio Code) so you can just run a debug, and all these errors can be seen at once, instead of fixing one error, then getting another, and another…