how to access nested arrays in arrays javascript code example
Example 1: Accessing Nested Arrays
var myPlants = [
{
type: "flowers",
list: [
"rose",
"tulip",
"dandelion"
]
},
{
type: "trees",
list: [
"fir",
"pine",
"birch"
]
}
];
var secondTree = myPlants[1].list[1];
console.log(myPlants[1].list[1]);
Example 2: javascript nested array
//2-dimensional(nested) array
var array = [[0,2,3,7,2,2,1],[1,2,6,3,7,0,3]]