Meal maker

having a bit of problems

You will need to generate a dish object…

let dish = {
    name: dishName,
    price: dishPrice
}

The courses getter may need to be revised to include the _courses context.

return {
    appetizers: this._courses.appetizers,
    ...
}

Assuming at the top of your code editor where we can’t see you have a menu object that includes a _courses object, your courses are appetizers, mains, and desserts. "wings" should be replaced with the name of the course ie. appetizers, mains or desserts.
Something like:
menu.addDishToCourse('mains', 'wings', 4.25);

didnt realize i forgot the top half

i did the changes but now i get the error of mains instead of wings

In your addDishToCourse method you have a : before your parameters. Also you are assigning the dishName and dishPrice as values for a dish object. The object should have properties that the values are assigned to.

const dish = {
  propertyName: propertyValue,
  propertyName: propertyValue
}

Also, just noticed another issue.
addDishToCourse:(courseName, dishName, dishPrice) => {
This syntax is incorrect for a method. First as mentioned before the : needs to go. Also the => needs to go. This is not a function, but a method. The arrow syntax doesn’t apply here, and will generate an error.

1 Like

You still haven’t fixed the two things I mentioned above.

i also removed the = from after dish

addDIshToCourse: => remove the colon. Same applies to all the methods.

methodName (params) {

}

Already mentioned, we cannot use arrow syntax on methods. See above model.

The courses getter actually works as is, and is written according to the instructions. It uses the getter for each course instead of returning the value straight from the ._courses object.

2 Likes

    let dish = {

    }

My bad. I keep stressing to people to use the getter if there is one.

i think this has been the toughest excercise for me… everything i do seems to cause another error in some way, im watching other examples in the forums n i think im lost

Line 43 has some issues.

Arrow function syntax.

Should have NO parameter.

1 Like
generateRandomMeal: (getRandomDishFromCourse) => {
  . . . . . . 
}

Need to delete the : and the =>

1 Like