Objects: Meal Maker

Hi,
I am just a bit confused with the Meal Maker activity.
https://www.codecademy.com/courses/introduction-to-javascript/projects/meal-maker

In the step by step guide,
it tells us to create multiple getters and setters…(with nothing inside it)
and I don’t see how it’s being used…

Since adding the dish, it just tells us to use
menu.addDishToCourse('appetizers', 'Caesar Salad', 4.25);

and when generating the meal (our final output)
it just uses console.log(menu.generateRandomMeal());

Please kindly clarify if possible.

Thanks

Sadly, the setters are not being used.

1 Like

Which specific part are you confused with?

The point of the Meal Maker activity, to me, is to …

understand javascript objects
practicing getters and setters ( " Why? Getters and setters allow you to easily insert and retrieve data out of an object." )
and create methods to use with said object.

Let me know if this gives you a better understanding of this activity. I would love to help any way I can.

Hi,
Ah no, I was just wondering because
In the hints section, they leave the getter and setter…empty with nothing
So I didn’t get what the purpose of it was for haha.
They didn’t have any steps that said call the getter or setter methods…
So I was confused with why they even put the step of creating an “empty” getter and setter in.

The next activity was more straightforward as it actually used the getter.

1 Like

The getters are not implemented in the walk-through. That’s left up to us. We’ve left a hundred clues as to how to make them work. The rest is up to the reader to read on.

2 Likes

Ahh Gotcha.

Sometimes those hints are just to get your brain moving. I kind of like it like that because not only are you learning how to read the syntax, you are critically thinking about the logic that makes each method.

I understand what you mean though.

1 Like