troubleshooting Question

Efficient Indexing of JSON Object Key in JavaScript

Avatar of MJ
MJFlag for United States of America asked on
JavaScriptJSON
6 Comments3 Solutions125 ViewsLast Modified:
I'm trying to figure out the most efficient way in javascript to take a value (x) and compare it against the key of the JSON object. If the key exists in the object then obviously it returns the value associated with the key. Also if the key doesn't exist, return false. I'm trying to make this as fast but browser friendly as possible.
var botwts={"98B17616F9EFA270B92602BD4AFAD1FA36BB53304A07589536F58CF85B4AC423":true,"7C887696418A36A1F6695280CF1D1E07710751D4A3DF9A4B04B0175FA1F1EE05":true,"B398E318FF11163E8372E0279EB567AF03DB4A10EFABE03689355A295CE9254B":true,"abc":true,"9486A4D194C12E0A6CC3B5464534F0C6E4EF10F85E3BDCD402059B73DEA61344":false}

Thanks In Advance!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros