i have a array banks
and I need to return one object with all the parameters described below
const banks = [{kod: 723,name: "bank",},{kod: 929,name: "bank2"}]
i tried to do it with
const lookup = banks.map(item => {
return ({[item.kod]: item.name })
})
but it returns the result [ {723: "bank"}, {929: "bank2"} ]
how can i achieve this result {723: "bank",929: "bank2"}