JavaScript Arrays loops and Object Meal maker project

In the Meal maker project I cant display total price because I am getting the type error message which says price is not defined.
here is the link to the exercise. https://www.codecademy.com/paths/web-development/tracks/web-dev-js-arrays-loops-objects/modules/learn-javascript-objects/projects/meal-maker

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 appetizers(appetizers){
    return this._courses.appetizers = appetizers
  },
  set mains(mains){
    return this._courses.mains = mains
  },
  set desserts(desserts){
    return this._courses.desserts = desserts
  },
  get courses(){
    return {
      appetizers:this.appetizers,
      mains:this.mains,
      desserts:this.desserts
    }
  },
  addDishToCourse(courseName, dishName, dishPrice){
const dish = {
  name:this.dishName,
   price:this.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.name}, ... The price is ${totalPrice}`
  },
}
menu.addDishToCourse('mains', 'Rice', 20)
let meal = menu.generateRandomMeal()
console.log(meal)

Hello @method0273814698, welcome to the forums! Could you please post your code? Make sure to follow the formatting guide in this post.

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