I am having a simple sample code as follows:
var sampleObj = [{prop1 : ""}, {prop2 : ""}, {propArr : [{key : "", value : ""}, {key : "", value : ""}]}];
This is a JSON Object that has some properties including a property that contains an array.
My Question
I need to use the JS method indexOf()
to get the index of [propArr] using the key not the value.
for example I need a way to implement this:
var index = sampleObj.indexOf(propArr);