Looping through Ajax JSON and only show entries where x=foo
Hi everyone,
Usually I'm using jquery like this, please let's discuss if I could do something better:
I'm loading the jsonfile as a global variable (called jsondata) and loop through it with $.each
In this example I want to get all the Ages for the people with the first name Martin
$.each(jsondata,function(index,value){
if(value["First Name"] == "Martin"){
console.log(value["Age"]);
}
})
Thank you so much in advance