Const myList = [" "]; [["chocolate", 1],["chips", 2],["biscuit", 3],["toffe", 4],["ice-cream", ]];

const myList =
[" "];
[[“chocolate”, 1],[“chips”, 2],[“biscuit”, 3],[“toffe”, 4],[“ice-cream”, ]];

  • Failed:The second elements in each of your sub-arrays should all be numbers.

  • Failed:You should have at least 5 items in your list.

Can you provide a link to the challenge this is for? Or at least the name of the challenge?

Your first statement is:

const myList = [" "];

Which creates an array with one item. Your next line is:

[[“chocolate”, 1],[“chips”, 2],[“biscuit”, 3],[“toffe”, 4],[“ice-cream”, ]];

This does define an array but that’s it. It doesn’t save the array to a variable. So this array just disappears after the line is executed.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.