Meal Maker TypeError: Cannot read property 'price'

You commented out correct code, and replaced it with incorrect code:

After deleting the incorrect code, and running your correct code, the error I see is:

TypeError: Cannot read property ‘price’ of undefined
It refers to this line:

  const totalPrice = appetizer.price + main.price + dessert.price;

So why is appetizer undefined?


You haven’t added any dishes. You need to use the menu.addDishToCourse() method a few times to have dishes to choose from.

1 Like

Thanks, for the feedback.
I knew I was forgeting something.

1 Like