This is a silly question, but I just stuck here.
Premise
let groups = [
{id: 1, name: '123'},
{id: 2, name: '456'}
]
And I want to output this
[
{value: 1, label: '123'},
{value: 2, label: '456'}
]
I don't understand why it causes an error.
groupOptions = groups.map(item =>
{value: item.id, label: item.name}
)