Answers for "let key of keys through two arrays"

53

js iterate object

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
0

js combine 2 array to object key value

var columns = ["Date", "Number", "Size", "Location", "Age"];
var rows = ["2001", "5", "Big", "Sydney", "25"];
var result =  rows.reduce(function(result, field, index) {
  result[columns[index]] = field;
  return result;
}, {})

console.log(result);
Posted by: Guest on July-06-2020

Code answers related to "let key of keys through two arrays"

Code answers related to "Javascript"

Browse Popular Code Answers by Language