Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Object.entries() To Use For Of On JSON


 const object1 = {
  a: 'somestring',
  b: 42
};

for (const [key, value] of  Object.entries(object1)) {
  console.log(`${key}: ${value}`);
}

// expected output:
// "a: somestring"
// "b: 42"
 
PREVIOUS NEXT
Tagged: #To #Use #For #Of #On #JSON
ADD COMMENT
Topic
Name
4+5 =