how to take object from array code example
Example 1: how to get array from object in javascript
let result = objArray.map(({ foo }) => foo)
Example 2: return an object from an array javascript
myArray.find(item => item.isAstronaut)
let result = objArray.map(({ foo }) => foo)
myArray.find(item => item.isAstronaut)