Nestef Arrays


Please, can you help me? I am new in this. I try to understand nested arrays.
I found out that:

const numberClusters = [[1,2], [3,4], [5,6]];
const target = numberClusters[2][1];
console.log(target) // print 6

But I do not understand how can this be 6? Why 6 and not 5? How this works?

Thank you for your time :slightly_smiling_face:

numberClusters[2] will give [5, 6] then you look at the second element/first index ([1]), which holds the value 6

Now I get it. Was really simple now that you explained to me.
Thank you very much.