I am trying to fetch two properties out of each array and then form a array out of this. I have also shown the expected output.
columns = [
{Header: ƒ, Cell: ƒ, sortable: false, show: true},
{Header: ƒ, accessor: "firstName", sortable: false, show: true},
{Header: ƒ, accessor: "status", sortable: false, show: true},
{Header: ƒ, accessor: "visits", sortable: false, show: true}
]
I want the output to be
[{name: "firstName",show: true},{name: "status",show: true},{name:"visits", show: true}]
I have tried this approach of getting one field, How do I get two values and then form a new array of objects itslef.
let keys = [...new Set(arr.map(arr => arr.accessor))]; // able to get one property, but need two in form of object