title: Maximum call stack size exceeded in object practice
body: <p>I'm currently learning to code and am on JavaScript. At the moment I am practicing with the use of objects by creating a random meal generator but I am very stuck. I keep getting the error &quot;Maximum Call Stack Size Exceeded&quot; could you please explain why and how I can fix it? Here's the code:</p>
  <pre><code>let menu={
    _courses:{
      appetizers:[],
      mains:[],
      desserts:[],
    },
    get appetizers(){
        return this.appetizers;
    },
    set appetizers(appetizersIn){
        this._courses.appetizers = appetizersIn;
    },
    get mains(){
        return this.mains;
    },
    set mains(mainsIn){
        this._courses.mains=mainsIn;
    },
    get desserts(){
        return this.desserts;
    },
    set desserts(dessertsIn){
        this._courses.desserts=dessertsIn;
    },
    get _courses(){
      return{
        appetizers: this.appetizers,
        mains: this.mains,
        desserts: this.desserts
      }
    },
    addDishToCourse(courseName,dishName,dishPrice){
        const dish ={
          dishName,
          dishPrice,
        }
        this._courses[courseName].push(dish);
    },
    getRandomDishFromCourse(courseName){
        const dishes=this._courses[courseName];
        const randomIndex = Math.floor(Math.random()*dishes.length);
        return dishes[randomIndex];
    },
  generateRandomMeal: function(){
    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 consists of ${appetizer.name}, ${main.name} and ${dessert.name} for dessert. That comes to a total price of £${totalPrice}`;
  }
  }
  menu.addDishToCourse(&quot;appetizer&quot;,&quot;Garlic Mushrooms&quot;,3.50);
  menu.addDishToCourse(&quot;appetizer&quot;,&quot;Garlic Bread&quot;, 2.50);
  menu.addDishToCourse(&quot;appetizer&quot;,&quot;Tomato Soup&quot;,4.00);
  menu.addDishToCourse(&quot;appetizer&quot;,&quot;Breadsticks and Dip&quot;,2.00);
  menu.addDishToCourse(&quot;appetizer&quot;,&quot;Spicy Chicken Wings&quot;,5.00);
  menu.addDishToCourse(&quot;main&quot;,&quot;Beef Lasagne&quot;,7.25);
  menu.addDishToCourse(&quot;main&quot;,&quot;Vegetarian Lasagne&quot;,7.25);
  menu.addDishToCourse(&quot;main&quot;,&quot;Fish and Chips&quot;,6.25);
  menu.addDishToCourse(&quot;main&quot;,&quot;Hunters Chicken&quot;,7.75);
  menu.addDishToCourse(&quot;main&quot;,&quot;Veggie Burger&quot;,5.50);
  menu.addDishToCourse(&quot;dessert&quot;,&quot;Eton Mess&quot;,4.00);
  menu.addDishToCourse(&quot;dessert&quot;,&quot;Knickerbocker Glory&quot;,3.50);
  menu.addDishToCourse(&quot;dessert&quot;,&quot;Chocolate Brownies with Cream&quot;,5.00);
  menu.addDishToCourse(&quot;dessert&quot;,&quot;Fruit Salad&quot;,2.50);
  menu.addDishToCourse(&quot;dessert&quot;,&quot;Apple Pie and Custard&quot;,4.75);
  const meal = menu.generateRandomMeal();
  console.log(meal);
  </code></pre>
  <p>Thank you in advance!</p>