Question re: Functional Programming: Use the filter Method to Extract Data from an Array

Hi. I’m working through the beta section on functional programming and am on “Use the filter Method to Exract Data.” My solution appears to check out with repl.it and the Chrome console, yet the fcc console won’t pass. Any chance s/one can spot the error I’m missing or is this particular challenge buggy.

I’m omitting the global array for brevity.

// Add your code below this line

var filteredList;

function findRatedTitles(arr){
    filteredList = arr.filter(function(item){
      item.imdbRating = Number(item.imdbRating);
      rating = item.imdbRating;
      if(rating >= 8){
        return rating;
      }
    }).map(function(item){
      var title = item.Title;
      var rating = item.imdbRating;
      var obj = {
        title,
        rating
      };
    return obj;
  });
  return filteredList;
}
findRatedTitles(watchList);

// Add your code above this line

console.log(filteredList);
1 Like