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.
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.
- I realized I could simply have appetizers, mains and desserts direct children of the menu object, which will shorten the neccessary code.
- 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!
(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)