My dataset looks like this:
var data = [
{
items: [
{
id: 123
},
{
id: 234
},
{
id: 123
}
]
}, {
items: [
{
id: 123
},
{
id: 234
}
]
}
]
I am looking to count the objects deeply nested in arrays within all data based on the 'id' property. e.g.
data.countObject('id',123) //return 3.
My data has approximately xx,000 items, what is the best solution for this?
Thank you for your assistance (apologies for any errors in my English).