0

Having the following

let el = [{a: "a", i: 1},{a: "b", i: 2},{a: "c", i: 3}]

How to get

[1,2,3] 

Ive tried

let arr = el.map(i => return [...i.i])
mouchin777
  • 1,033
  • 1
  • 18
  • 37
  • 2
    `let arr = el.map(o => o.i)`. no need for spread because you're mapping from an array with three items to an array with three items. – Heretic Monkey Feb 23 '22 at 16:33

0 Answers0