Answers for "es6 for loop object"

26

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
2

es6 loop through object

for (var [key, value] of phoneBookMap) {
  console.log(key + "'s phone number is: " + value);
}
Posted by: Guest on July-13-2020
5

javascript iterate object key values

Object.entries(obj).forEach(([key, value]) => {
	console.log(key, value);
});
Posted by: Guest on March-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language