Project Meal Maker – trimmed solution

Hi everyone,

I’m quite new to programming (less than a month), and some exercises feel mammoth-like to me as a beginner. Such is the case with the Meal Maker project. Hence, today I decided to revisit it and declare it war (in a friendly way) with the best of my intentions … and resilience. :sweat_smile:

What did I find out after all this day’s detective work ? If you found this exercise somewhat challenging to digest, it may help to realize that steps 2-6 are of no effect to the specific purpose of randomizing a three course meal. This made me develop a stronger appreciation for different JS concepts and what code does what.

  1. I realized I could simply have appetizers, mains and desserts direct children of the menu object, which will shorten the neccessary code.
  2. I then had to adapt the getters and setters not to incur in a call stack error. Later, I also realized they have no impact for the purpose of randomizing a meal.

I’ve read it’s good practice to have getters and setters up. Also, having a _course section encapsulate the different courses may be helpful.
But it did help me better understand the exercise by realizing the above. Hope this may help you to.

Thanks, and good coding! :slight_smile:

(ps: it might also be easier to start with the project Team Stats - which is about creating a method to add object instances into an array - and then move back to Meal Maker)


@alyssavigil, perhaps it would be a good idea for the course author to weigh in on this topic. A lot of learners have grappled with this project.


I asked the team! We’ll see what they say. :muscle:


yes, and for the first time i found the tutorial not very explanatory, more like just execution from an experience coder doing coding than tutorial.


I can’t seem to understand this one. The get help was literally the same hints given by the project.

Yeah, this project needs a revamp. Hopefully that happens.

Hi guys. I’ve been learning also and had some issues initially but eventually I got to sort it without help the second time around.

Key points would probably be the clear understanding of the this. keyword (which I’ve come to understand is a hot topic to everyone) and testing your methods as you build them.

In this case because you have 3 arrays declared but not initialised (aka empty) you wont be able to test them so I suggest either having something in there so you can log and see the results as you go.

Hope my code and suggestions help.

Happy Coding!

This definitely helped clean up my code compared to the walkthrough… thank you! Still getting undefined values when I print it out though