In your example JavaScript treats { and } as a block statement instead of object literal. Wrap your object in brackets (( and )) and it will work.
Corrected code:
const data =
results.responses.map((response, idx) =>
({ id: idx+1,
name: response.name,
email: response.email,
comment: response.comment
})
)