Why isn't this snippet working for question 157?

Why isn't this snippet working for question 157?
0

#1
var myList = [
         ["No Dairy", 5, "Wine", 5, "Eggs", 5, "Pizza", 5, "Toast", 5 ], 
         ["Wine", 5, ["Ice Cream", 5 ], 
         ["Eggs", "Gum", 5 ], 
         ["Cheese", "Fruit", 5 ], 
         ["Onion", "Pear", 5 ],
          ]
          
];

console.log(myList);

I just wanted to mention that this is the error:
You must have at least 5 items in your list
and when it logs it does have 5 items. Any help is humbly appreciated. :pray:


#2

I think you have unintentionally inserted brackets at the wrong places. myList actually has just 2 items in it:

var myList = [
  // this one
  ['No Dairy', 5, 'Wine', 5, 'Eggs', 5, 'Pizza', 5, 'Toast', 5],
  // and this one
  [
    'Wine',
    5,
    // the rest are nested inside the second item
    ['Ice Cream', 5],
    ['Eggs', 'Gum', 5],
    ['Cheese', 'Fruit', 5],
    ['Onion', 'Pear', 5],
  ],
];

Try removing the bracket before 'Ice Cream' and the lone closing bracket after the onion-pear array.

PS. Challenges are not numbered. The number is your fCC score. If you have questions about challenges, you should refer to them by name.


#3

Thank you! I did not see that! Have a wonderful night!