I'm having a problem writing some Javascript code. I'm trying to use the map function to create a new array. Here's my code:
[1,2,3].map(m => {'id': m})
I expected that the result would be:
[
{'id': 1},
{'id': 2},
{'id': 3}
]
Instead, I get an error that says "Uncaught SyntaxError: Unexpected token :"
Can someone tell me what I'm doing wrong?