I am currently attempting to convert an arrow function into a regular function.
This is the code snippet I am working with:
let ratings = watchList.map( (item) => {"title": item["Title"], "rating": item["imdbRating"]} )
The goal is to rewrite it as follows:
let ratings = watchList.map(function (item) {
"title": item["Title"], "rating": item["imdbRating"]
})
Although initially I thought these two versions were equivalent, I encountered the following error message:
SyntaxError: unknown: Unexpected token, expected