Cannot read property 'push' of undefined

I’ve looked through the forums and have tried a few of the suggested solutions, but they don’t work for me. I’d greatly appreciate an answer!

Well, do you agree that undefined doesn’t have a push property?
Where did you get undefined from? Expected something else? If you meant to have a different value there, clearly you don’t and would need to put it there first.

can you post your line 45? apparently that’s where the problem is.

1 Like

It’s shown in its entirety in the error message, though, not sure it’ll help much.

The entire situation looks something like this:

stuff = {}
stuff['something'].push

where a key that isn’t there was looked up, followed by trying to use the result, of which there is none

then probably _courses wasn’t well defined

1 Like

So I actually found the issue it seemed that I forgot to add “S” on getRandomDishFromCourse(‘dessert’); and getRandomDishFromCourse(‘appetizer’);
This ended up giving me a different issue which in summary could not take the length of an unknown object. Thanks for providing possible solutions as they did help me look back and double check!

1 Like

Hi giga! So we cannot access your link for the code, but what you can do is either copy and paste your code onto google docs and share that link or you could screenshot the code. If you have a mac screenshot command is control + shift + 3

Clicking on the link, as @davidhuang8989854124 indicated does not show your code. The link is to the exercise, so we see our own code if we’ve done the project. You can simply copy & paste your code into a reply by clicking on the </> icon, and then pasting your code in the space indicated:
image
capture_r