Answers for "how will you loop through all the properties of an object js"

7

javascript loop through object values

var myObj = {foo: "bar", baz: "baz"};
Object.values(myObj).map((val) => {
console.log(val);
})
// "bar" "baz"
Posted by: Guest on June-11-2020
1

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 will you loop through all the properties of an object js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language