Problem with Accessing Nested Arrays

Tell us what’s happening:
Hello, can you help me understand what i’m doing wrong?

Thank you

Your code so far

// Setup
var myPlants = [
    type: "flowers",
    list: [
    type: "trees",
    list: [

var secondTree = myPlants[2].list[2]; 

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36.

Link to the challenge:

As you must have learnt in previous examples, arrays are zero-indexed.

For example i have an array:

var arr = [1,2,3,4,5]

So, to access the first element that is 1, we will use arr[0] and to get the second element that is 2,
we use arr[1].

Hope this helps.

1 Like