Given a JSON Object’s tree and the task is to find a particular piece of information. Suppose we want to find the information about a particular person in that object then how do we do that. Here are two approaches that are discussed below:
Approach 1: In this approach, we will use each() method and pass the real array of objects to the method by using the dot operator and then in the anonymous function find the person by comparing its name.
Approach 2: In this approach, we will use grep() method and pass the actual array of objects to the method by using dot operator and then return the object which matches the criteria and then we print the age of the person.
- JSON | modify an array value of a JSON object
- Convert minutes to hours/minutes with the help of JQuery
- How to universally parse JSON into blocks using jQuery ?
- How to fetch data from JSON file and display in HTML table using jQuery ?
- Node.js Bot.help() Method
- How to use jQuery to Search and Replace HTML elements?
- Autocomplete Search using jQuery and Wikipedia OpenSearch API
- jQuery | jQuery.fx.interval Property with example
- jQuery | jQuery.fx.off Property
- jQuery | jQuery.support Property
- jQuery | jquery Property
- Node.js | package.json
- Google Geo-coding Web Service (JSON response)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.