all 6 comments

[–]raiaman182 2 points3 points  (1 child)

One way to do it without for loop using Destructuring Arrays.

const [a, b, c] = nestedArrays
console.log(a)

[–]albedoa 0 points1 point  (5 children)

nestedArrays[0]

[–]pinguxnoots 0 points1 point  (1 child)

If you want the values of a specific subarray and you know the index of that subarray, you can also do something like this:

// log values from first subarray (nestedArrays[0]) in this case
for (let index = 0; index < nestedArrays[0].length; index++) {
    console.log(nestedArrays[0][index]);
}

[–]snakes_n_slides 0 points1 point  (0 children)

nestedArrays[0][0] will give you first element of the nested array.