How to use the spread operator to access element in my array of object ?
const array = [{ obj: 1},{ obj: 2}]
console.log([...array].obj)
// Output undefined
console.log([...array.obj])
// Output Uncaught TypeError
I've seen this post Use spread operator on objects array? which is quite similar but they do not try to access elements.
So is it possible to use spread operator on array of object to access elements ? If so how ?