Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js array of objects get a specific key from all objects

let users = [
  {
    name: 'John',
    age: 20,
  },
  {
    name: 'Richard',
    age: 25,
  }
];

let names = users.map(user => user.name);

// ['John', 'Richard]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #array #objects #specific #key #objects
ADD COMMENT
Topic
Name
7+9 =