Meal Maker, can't push in to array

Please Help! I’ve been stuck on this for almost a week. What’s wrong with my code?

Here’s the error I’m getting now:
this._courses[courseName].push(dish);
^
SyntaxError: Unexpected token .
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions…js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_no

Hi @melprimrose777985690
you need to write your object methods with the usual syntax for functions. This is what you’ve done:

addDishToCourse: function  (courseName, dishName, dishPrice) {
  const dish = {
dishName: this.dishName,
dishPrice: this.dishPrice,
        this._courses[courseName].push(dish); 

}

That’s how you should write your methods:

addDishToCourse(courseName, dishName, dishPrice) {
    let dish = {
      name: dishName,
      price: dishPrice
    };
    this._courses[courseName].push(dish);
  }

}

Also inside your dish object, you want to get the arguments given to the parameters by your function call. Therefore you wouldn’t reference the values already stored in the _courses object. So instead of:

dishName: this.dishName,
dishPrice: this.dishPrice,

you’d write

name: dishName,
price: dishPrice,

in your method.

I made the corrections you suggest, and I’m still getting the same error.

You just corrected the method I gave as an example. You have to treat them all the same, of course.

I made the method changes, but I’m still getting the same error.

I don’t think it’s the same error, we’re at another point now.
Check your scope: Not all functions have matching closing braces.
Then there is this:

addDishToCourse (courseName, dishName, dishPrice) {
  let  dish = {
name: dishName,
price: dishPrice,
        set appetizers(newAppetizers); // where does this variable come from?
  }