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,420
  • 5
  • 42
  • 63
Er Ekta Sahu
  • 363
  • 4
  • 14

2 Answers2

1

use with Array#map

arrayOfObj.map(a=>a.id)
prasanth
  • 22,145
  • 4
  • 29
  • 53
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