I’ve been trying to structure the menu for this codeacademy project: https://www.codecademy.com/courses/introduction-to-javascript/projects/meal-maker but am running into structure trouble. I’ve checked syntax for getters and setters and also have read quite a few syntax descriptions for objects and properties, mostly at MDN web docs, but still seem to have some errors. I would love some feedback on what I’ve structured and how to improve it. Thanks for your thoughts!
const menu = {
_courses: {
appetizers: {
get getAppetizers(){
return this.appetizers;
},
set changeAppetizers(newAppetizers){
this.appetizers = newAppetizers;
}
}
mains: {
get getMains() {
return this.mains;
},
set changeMains(newMains){
this.mains = newMains;
}
}
desserts: {
get getDesserts(){
return this.desserts;
},
set changeDesserts(newDesserts){
this.desserts = newDesserts;
}
}
}
}