Tell us what’s happening:
I’m confused why this solution works. Don’t we need to convert the imdbRating from a string to an integar?
How does the current filter work if it’s checking for an integar (“8”) against a string (the imdbRating)?
Your code so far
var filteredList = watchList
.map(function(e){
return {title: e["Title"], rating: e["imdbRating"]};
})
.filter(e => e.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: