0

For example: if I have a list of records, like this:

[
  {
    'id' : 1,
    'name' : 'Renato'
  },
  {
    'id' : 2,
    'name' : 'John'
  }
]

and I want to get a list of id.

Renato Oliveira
  • 456
  • 2
  • 7
  • 21
  • A [map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) works perfectly here: `arr.map(item => item.id);` As @mhodges said, check out the suggested existing question. – nem035 May 15 '17 at 17:44
  • 'var map = Array.prototype.map;' then `rec.map(function(currentValue,index,array){return currentValue.id})` – Bill Bell May 15 '17 at 18:13

0 Answers0