Answers for "how to iterate through object keys and assign value javascript"

5

javascript iterate object key values

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

going through every attributes of an object javascript

let a = {x: 200, y: 1}
let attributes = Object.keys(a)
console.log(attributes)
//output: ["x", "y"]
Posted by: Guest on April-09-2020

Code answers related to "how to iterate through object keys and assign value javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language