Answers for "javascript loop to create new object"

85

javascript loop through object

Object.entries(obj).forEach(
    ([key, value]) => console.log(key, value)
);
Posted by: Guest on February-15-2020
10

javascript loop through object

var obj = { first: "John", last: "Doe" };

Object.keys(obj).forEach(function(key) {
    console.log(key, obj[key]);
});
Posted by: Guest on September-11-2019

Code answers related to "javascript loop to create new object"

Code answers related to "Javascript"

Browse Popular Code Answers by Language