Answers for "iterate through json object array javascript"

53

javascript iterate over json

var person={
 	first_name:"johnny",
  	last_name: "johnson",
	phone:"703-3424-1111"
};
for (var property in person) {
  	console.log(property,":",person[property]);
}
Posted by: Guest on July-22-2019
1

javaScript loop json array

var people = [{
    "name" : "Darren", 
    "age" : "24",
    "gender"   : "Male",
    
},{
    "name" : "Mai", 
    "age" : "28",
    "gender"   : "Female",
    
}];

for(var i = 0; i < people.length; i++) {
    var person = people[i];

    console.log('Name: '+person.name+' Age:'+person.age);
}
Posted by: Guest on July-22-2021

Code answers related to "iterate through json object array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language