Basic JavaScript - Shopping List

Tell us what’s happening:
Describe your issue in detail here.
I’m not sure what I’m doing wrong. its telling me TypeError: Cannot read properties of undefined (reading ‘1’), but I wrote it the same as the others.

Your code so far

const myList = [["bread", 1]["milk", 1]["eggs", 1]["cheese", 1]["oranges", 12]];

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Shopping List

Link to the challenge:

You are missing commas to separate your sub arrays.

Hope that helps!

1 Like