Functional Programming: Use the map Method to Extract Data from an Array (not working)

why isn’t my code working?
I have:

var rating = [];
let rating = watchList.map ((val)=>({"title": val["Title"], "rating": val["imdbRating"]}));

oh I declared rating two times that was all, sorry