I’m in a problem known as, Functional Programming: Use the map Method to Extract Data from an Array.
Here is what I want,
[{"title":"Inception","rating":"8.8"},{"title":"Interstellar","rating":"8.6"},{"title":"The Dark Knight","rating":"9.0"},{"title":"Batman Begins","rating":"8.3"},{"title":"Avatar","rating":"7.9"}]
Here is what I did so far,
["{title : Inception,rating : 8.8}","{title : Interstellar,rating : 8.6}","{title : The Dark Knight,rating : 9.0}","{title : Batman Begins,rating : 8.3}","{title : Avatar,rating : 7.9}"]
My code,
var ratings = watchList.map(movie => "{"+"title : "+ movie.Title +","+ "rating : "+ movie.imdbRating +"}");
Why I can’t reach my expectation?