[英]How to get first grand child of an array inside of array
I have an array with 10 elements. 我有一个包含10个元素的数组。 Each element is also an array and each of their children are objects.
每个元素也是一个数组,每个子元素都是对象。
Lets call it "array". 让我们称之为“数组”。
array[0] gives me the first element. array [0]给我第一个元素。 It is filled with 20 objects.
它充满了20个对象。
I want to get the first one, and then a value in that object, such as this: 我想要获取第一个对象,然后获取该对象中的值,例如:
var id = array[0].getFirstElement().id;
How do I do it? 我该怎么做?
I tried array[0][0] and other things but didn't work. 我尝试了array [0] [0]和其他方法,但是没有用。
For this example 对于这个例子
array = [[{id:2, ...}, ...], ...]
You need array[0][0].id
您需要
array[0][0].id
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.