Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript object get value by key

const person = {
  name: 'Bob',
  age: 47
}

Object.keys(person).forEach((key) => {
  console.log(person[key]); // 'Bob', 47
});
 
PREVIOUS NEXT
Tagged: #javascript #object #key
ADD COMMENT
Topic
Name
2+1 =