its failing the last test even though am getting the right answer (8.675) can someone tell me what am doing wrong
function getRating(watchList) {
// Only change code below this line
let averageRating = watchList
.filter(x => x.imdbRating > 7.9)
.reduce((pre, cur) => pre + parseFloat(cur.imdbRating), 0) / 4;
// Only change code above this line
return averageRating; // 8.675 which is the right answer
}
console.log(getRating(watchList));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36