Stuck on Functional Programming: Use the filter Method to Extract Data from an Array

Hi, I’m stuck on https:// learn. freecodecamp. org/javascript-algorithms-and-data-structures/functional-programming/use-the-filter-method-to-extract-data-from-an-array/ (can’t post links yet) but I feel that I am very close.

Anybody know what I am doing wrong?

// Add your code below this line
var ratingFilter = watchList.filter(movie => { return movie.imdbRating >= 8}); 
var filteredList = ratingFilter.map(movie => ({Title: movie.Title, Rating: movie.imdbRating}));

// Add your code above this line
//console.log(ratingFilter);
console.log(filteredList); 

I don’t know which problem this is to give further advice…

Yeah , you are close, however,

  1. you should be mapping over the list you filtered in the previous step
  2. you have some spelling errors while mapping (remember that JavaScript is case sensitive)

Sorry, was playing around with the code and pasted the wrong version (corrected above now). I was using the filtered list.

Turns all I had to do is change Title to title and Rating to rating.

Thanks!!

Important to people out there, if the word “filteredList” is not used in the console.log, this exercise will NOT complete, hence although there may have been other exercises where you could change the variable from the console output, this one will fail each time, even when correct.
Stick to -->

// Add your code above this line    !!!
console.log(filteredList);