Mixed Messages - Meal Picker

Hey everyone! Here is my project, I went ahead and tried making a readme.md as well just for practice as I know that it will be useful in the future! Any feedback will be greatly appreciated!

1 Like

Cool project! I was also thinking about doing a meal planner for mine.

mealOptions.breakfast[randomNumber(mealOptions.breakfast.length)]

One point of feedback - I think the above code is a bit redundant to have mealOptions.breakfast twice, so in my project, I used the helper function to return a random item in an array.

In your code, you use a helper function to generate a random number in the range of the array length that you used for the index. You could extract the value of the array at that index here as well. That way, your call to the helper function at the end could look something like the below and simplifies it a bit.

randomItem(mealOptions.breakfast)