get an object from an array of object javascript 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)