Answers for "javascript object traversal"

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
0

object traversal javascript

for (var prop in obj) {
    obj[prop] = 'xxx';
}
Posted by: Guest on December-28-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language