How does Javascript interpret parantheses?

I am currently working through functional programming exercises and working with the map method for the first time.

The relevant exercise requires map to be called on an array of objects, and return an array of objects with only two of the parent object’s properties.

When I write the callback function, the solution works out to:

var ratings = watchList.map(item => ({ title: item.Title, rating: item.imdbRating }))

This solution requires a parantheses around the returned object for the callback function inside map.
My question is, why? Why isn’t the following acceptable:
var ratings = watchList.map(item => { title: item.Title, rating: item.imdbRating })

The full code for the exercise is here:

1 Like