ashur
September 11, 2022, 2:55pm
1
sooooo i the course gave me a task that I have to make a shopping list and the list should be a multi-dimensional array containing several sub-arrays.
And somehow, a error pop up says this .
“TypeError: Cannot read properties of undefined (reading ‘3’)”
sooooo a lil’ help? please
this is my code:
const myList = [
[“something” , 1]
[“another thing” , 2]
[“another another thing” , 3]
[“aaaaaaaaaaa” , 4]
[“out of idea” , 5]
];
**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:
Please post your actual code instead of a picture. Thanks
Or is that the same code in the picture as you posted? Hard to tell from the picture.
ashur:
const myList = [
[“something” , 1]
[“another thing” , 2]
[“another another thing” , 3]
[“aaaaaaaaaaa” , 4]
[“out of idea” , 5]
];
Array elements must be separated by commas.
1 Like
ashur
September 11, 2022, 2:58pm
4
this is my code, i posted it below the picture.
const myList = [
[“something” , 1]
[“another thing” , 2]
[“another another thing” , 3]
[“aaaaaaaaaaa” , 4]
[“out of idea” , 5]
];
ashur
September 11, 2022, 3:00pm
5
omg thx u so much, it worksss
1 Like
system
Closed
March 13, 2023, 3:00am
6
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.