Meal Generator Project

Hello, I am struggling with the Meal Generator project in Javascript objects.

https://www.codecademy.com/paths/web-development/tracks/web-dev-js-arrays-loops-objects/modules/learn-javascript-objects/projects/meal-maker

Here is my code.

const menu = {
_courses: {
  appetizers: [],
  mains: [],
  desserts: [],
},
get appetizers() {
  return this._courses.appetizers;
},
get mains() {
  return this._courses.mains;
},
get desserts() {
  return this._courses.desserts;
},
set appetitzers(appetizers) {
  this._courses.appetitizers = appetizers;
},
set mains(mains) {
  this._courses.mains = mains;
},
set desserts(desserts) {
  this._courses.desserts = desserts;
},
get courses() {
  return {
   appetizer: this.appetizers,
   mains: this.mains,
   desserts: this.desserts,
  };
},
addDishToCourse(courseName, dishName, dishPrice) {
  const dish = {
    name: dishName,
    price: dishPrice,
  };
  return this._courses[courseName].push(dish);
},
getRandomDishFromCourse(courseName) {
  const dishes = this._courses[courseName];
  const randomIndex = Math.floor(Math.random() * dishes.length);
  return dishes[randomIndex];
},
generateRandomMeal() {
  const appetizer = this.getRandomDishFromCourse("appetizers");
  const main = this.getRandomDishFromCourse("mains");
  const dessert = this.getRandomDishFromCourse("desserts");
  const totalPrice = appetizer.price + main.price + dessert.price;
  return `Your meal is ${appetizer.name}, ${main.name}, ${dessert.main}, and the total price is ${totalPrice}`;
},
};

menu.addDishToCourse("appetizers", "salad", 4.00);
menu.addDishToCourse("appetizers", "wings", 5.00);
menu.addDishToCourse("appetizers", "fries", 4.50);

menu.addDishToCourse("mains", "steak", 10.00);
menu.addDishToCourse("mains", "salmon", 7.00);
menu.addDishToCourse("mains", "tofu", 11.50);

menu.addDishToCourse("desserts", "cheesecake", 4.00);
menu.addDishToCourse("desserts", "ice cream", 5.00);
menu.addDishToCourse("desserts", "brownie", 4.50);

let meal = menu.generateRandomMeal();
console.log(meal);

When I run it, it prints ‘undefined’ for the dessert, and I cannot see where I went wrong. I’d appreciate a second (or third) set of eyes. Thank you!

here:

  return `Your meal is ${appetizer.name}, ${main.name}, ${dessert.main}, and the total price is ${totalPrice}`;

you use dessert.main, why? Shouldn’t this be .name? same as you have for appetizer and main?

Thank you very much! It worked!