0
var arrayOfObj = [{id: 41, uid: "62d0e9d5-25d4"},
        {id: 42, uid: "62d0e9d5-25d4},
        {id: 43, uid: "62d0e9d5-25d4},
        {id: 44, uid: "62d0e9d5-25d4}];

expected result: a= [41,42,43];

Venkat.R
  • 7,152
  • 5
  • 38
  • 62
Er Ekta Sahu
  • 363
  • 3
  • 13

2 Answers2

1

use with Array#map

arrayOfObj.map(a=>a.id)
prasanth
  • 21,342
  • 4
  • 27
  • 50
0

You can do it with javascript map function. Read the docs here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map