Passing in the key and returning the object javascript

With a JSON array structured like this one,

"object1": {
  "key1": "value1"
  "key2": "value2"
}
"object2": {
  "key3": null
  "key4": null
}
}

Could I pass in the key eg. key3 and get returned the object it is part of eg. object2?

I know this would be possible with a for loop, but I have a lot of keys so I am wondering if there is another way.

Thanks



from Recent Questions - Stack Overflow https://ift.tt/2WYPKMk
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept