Tell us what’s happening:
ratings
should equal
[{"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"}]
i tried with" . " notation. receiving above error;
i tried with"[ ]" notation. it passed.
i am confused…
Your code so far
// Only change code below this line
var ratings = watchList.map(item=>({tilte:item.Title,rating:item.imdbRating}));
// Only change code above this line
recommend solutions
const ratings = watchList.map(item => ({
title: item["Title"],
rating: item["imdbRating"]
}));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36
.
Challenge: Use the map Method to Extract Data from an Array
Link to the challenge: