Can someone help me to fix the code of the project called "meal maker" in javascript exercise?

hi
I was practicing the project of “meal maker”. there are something wrong at the result . hope someone can help me . Thank you!!!

here is the link!!

  set appetizers (appetizers) {
    this._courses.appetizers = appetizers
  },
  set mains (mains) {
    this._courses.mains = mains
  },
  set desserts (desserts) {
    this._courses.desserts = desserts
  },

To mitigate possible confusion, suggest using a singular as the parameter.

set appetizers (appetizer)
    this._courses.appetizers = appetizer

However, that will overwrite the array. Instead we could push it…

set appetizers (appetizer) {
    this._courses.push(appetizer)
}

Thanks for your answers. Problem has been solved.

发自我的iPhone

1 Like

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