How to use Setter method alternatively to my code to push object in one of the course array using addDishToCourse method?

const menu = {
  _courses: {
     appetizers: [],
     mains: [],
     desserts: [],
  },
  get appetizers() {
    return this._courses.appetizers;
  },
  set appetizers(appetizers) {
    this._courses.appetizers = appetizers;
  },
  get mains() {
    return this._courses.mains;
  },
  set mains(mains) {
    this._courses.mains = mains;
  },
  get desserts() {
    return this._courses.desserts;
  },
  set desserts(desserts) {
    this._courses.desserts = desserts;
  },
  get courses() {
    return {
    appetizers: 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 appetizers = this.getRandomDishFromCourse('appetizers');
    const mains = this.getRandomDishFromCourse('mains');
    const desserts = this.getRandomDishFromCourse('desserts');
    const totalPrice = appetizers.price + mains.price + desserts.price;
    return `Your meal is ${appetizers.name}, ${mains.name} and ${desserts.name}. The price is ${totalPrice}.`;
  }
};
menu.addDishToCourse('appetizers', 'Salat Mewaee', 5.50);
menu.addDishToCourse('appetizers', 'Mast', 6);
menu.addDishToCourse('appetizers', 'Kachaloo', 1.5);
menu.addDishToCourse('mains', 'Qahwa', 3);
menu.addDishToCourse('mains', 'Sheer', 4);
menu.addDishToCourse('mains', 'Chai', 2.5);
menu.addDishToCourse('desserts', 'Freenee', 9);
menu.addDishToCourse('desserts', 'Kheer', 8);
menu.addDishToCourse('desserts', 'Mewa', 10);

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

Note that you don’t need return in the addDishToCourse function (because the purpose of the function is to change something in the object, not to provide the value of something), and I think that .push() returns the length of the array, which you don’t need.

Since, .courses is a getter for ._courses,
you could replace
this._courses[courseName].push(dish);
with
this.courses[courseName].push(dish);

Alternatively, you could use the getters .appetizers and .mains and .desserts (for the menu object) instead;
one version of that is
this[courseName].push(dish);