How can I do a query to an array javascript, for example I want to find all names that begin with A, an then show all information
Name”:”Albert”,”age”:”14″
Name”:”Alison”,”age”:”14″
this is my array json:
var house = [{"Name":"Jason","age":"43"},
{"Name":"Albert","age":"14"},
{"Name":"Luck","age":"14"},
{"Name":"Alison","age":"14"},
{"Name":"Tom","age":"12"}]
You can filter an array, to collect the elements with an ‘A’ name, then forEach or map the matches to a new array of property names and values
/* returned value: (String)*/
If you need a shim: