Validation issue in Functional Programming

Hello everyone!

I’m trying to understand why my code is not valid even when the result is the expected. Probably I’m missing something but I cannot identify what it could be yet.

“filteredList” content is correct, but somehow the system doesn’t consider it as a correct answer. I’d appreciate your comments.

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

var filteredList = temp.filter(movie => movie.rating > 8);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36.

Challenge: Use the filter Method to Extract Data from an Array

Link to the challenge:

You are missing the decimal point on the “The Dark Knight” rating (you have 9 it should be 9.0). You can give the toFixed method a look.

1 Like

Hello @lasjorg Thank you so much for your answer. I thought I checked that. I still need more practice and more detail in the comparison of the results. I applied what you’ve recommended and it’s working now. Thanks again!