Answers for "javascritp iterate object"

32

iterate object javascript

let obj = {
	key1: "value1",
	key2: "value2",
	key3: "value3",
	key4: "value4",
}
Object.entries(obj).forEach(([key, value]) => {
	console.log(key, value);
});
Posted by: Guest on May-02-2020
0

javascript iterate objects

for (let key in yourobject) {
  console.log(key, yourobject[key]);
}
Posted by: Guest on December-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language