get array in object javascript code example
Example 1: how to get array from object in javascript
let result = objArray.map(({ foo }) => foo)
Example 2: return array javascript
function func() {
return [5, "string", {a: 7}];
}
let result = objArray.map(({ foo }) => foo)
function func() {
return [5, "string", {a: 7}];
}