JSFiddle - React, Tailwind, and code Playground
JavaScript
const temp = [{
name: 'james'
}, name: 'ally']
const new = temp.map(obj => ({
`${obj.name}`: null
}))
const temp = [{
name: 'james'
}, name: 'ally']
const new = temp.map(obj => ({
`${obj.name}`: null
}))