Answers for "iterate over list of objects javascript"

53

javascript loop through array of objects

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
4

javascript loop through array of objects

var people=[
  {first_name:"john",last_name:"doe"},
  {first_name:"mary",last_name:"beth"}
];
for (let i = 0; i < people.length; i++) { 
  console.log(people[i].first_name);
}
Posted by: Guest on June-17-2019

Code answers related to "iterate over list of objects javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language