I’ve been working on the Meal Maker assignment and I think I have a good understanding of some of the previous concepts we’ve used in the lessons.
The only part of the assignment I can’t seem to wrap my head around is part 11.
How does this work?
const totalPrice = appetizer.price + main.price + dessert.price
return `You ordered ${appetizer.name}, ${main.name} and ${dessert.name}. Your total price is $${totalPrice}.`
How are we able to access price and name using the course choices (i.e appetizers, mains, desserts)?
That makes more sense, but just to clarify, when we use “appetizer.price” or “main.name” are we able to use those values because of the get methods we had created at the beginning of the assignment?
I get what you are saying, its based off the courseName parameter that we pass into the function and it will randomly pick one of the three options in the program.