Is it possible to generate hashmap for JSON object in javascript/jquery? I’ve complex and big JSON object. I’ve to loop through it to filter data based on timings.
What is will be best and optimum approach to get data from JSON/hash map?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Most browsers contain a native JSON object with a JSON.parse(JSONstring) method for just this. jQuery provides $.getJSON(JSONstring) to return an object from a JSON string in environments that don’t natively provide the JSON object.
From there on, getting a useful hashmap depends on the structure of your JSON object. Underscore (and its more performant offshoot, LoDash) contains a lot of useful methods (such as filter) which can help parse, manipulate and retrieve useful data from large objects.