{
"myJSONArrayObject": [
{
"12": {}
},
{
"22": {}
}
]
}
I have the above JSON Array object. How can I check if myJSONArrayObject has a particular key?
This approach is not working :
let myIntegerKey = 12;
if (myJSONArrayObject.hasOwnProperty(myIntegerKey))
continue;
It seems to return false when it contains a key and true when it doesn't.
[{ "id": 12, "value": {} }, { "id": 22, "value": {} }]. Way easier to search/transform than when every object inside the array has different keys.