I want to return a new array but take the property value to become property name.
const temp = [
{name: 'james'},
{name: 'ally'}
]
const new = temp.map(obj => ({
`${obj.name}`: null
}))
Obviously it doesn't work this way. Any clue? https://jsfiddle.net/qg8ofom1/