Meal Maker Project, trying to understandgetters

Hello! I am just stuck on understanding why this code:

get courses () {
return {
appetizers: this.appetizers,
mains: this.mains,
desserts: this.desserts
};

What does appetizers: this.appetizers do exactly?

Hope you’re not jumping ahead of the core material expecting this project to be easy, and a complete learning experience. It is no substitute for the basics. Have you studied what this is, yet?

Hello Mtf!

Thank you for the reply. I have ran over the the advanced objects lesson a few times and wasn’t able to find an example of this. I just wanted to understand what “appetizers : this.appetizers” does.

Fair enough, it just strikes one as the sort of question that wouldn’t come up after studying advanced objects.

{
appetizers: this.appetizers,
mains: this.mains,
desserts: this.desserts
}

is just an object. appetizers: this.appetizers doesn’t do anything since it is not a behavior, but a key-value pair. That is why I asked if you have an understanding of,

this

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.