I have an array called mainarray
which has three objects inside it. Inside each object there's another array called innerarray
which has its own three objects.
How do I get the first property of every second object inside each of the innerarray
? Is this possible?
mainarray: [{
innerarray: [{
property1: value1,
property2: value2,
property3: value3,
}, {
propertyiwant: value1,
property2: value2,
property3: value3,
}, {
property1: value1,
property2: value2,
property3: value3,
}]
}, {
innerarray: [{
property1: value1,
property2: value2,
property3: value3,
}, {
propertyiwant: value1,
property2: value2,
property3: value3,
}, {
property1: value1,
property2: value2,
property3: value3,
}]
}, {
innerarray: [{
property1: value1,
property2: value2,
property3: value3,
}, {
propertyiwant: value1,
property2: value2,
property3: value3,
}, {
property1: value1,
property2: value2,
property3: value3,
}]
}]
This question is totally different than From an array of objects, extract value of a property as array. As here i am trying to get property of an object inside an array which is inside another array.