Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript foreach array of object get value by key

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

for (const [key, value] of Object.entries(object1)) {
  console.log(`${key}: ${value}`);
}
 
PREVIOUS NEXT
Tagged: #javascript #foreach #array #object #key
ADD COMMENT
Topic
Name
1+2 =