Add comments and update callback arguments' names #36082
I've added a few comments to the solution and given the callback arguments more descriptive names to clarify what the solution is doing, since this challenge seemed a little more complex than the previous challenges.
After reviewing this again, I realize it is not using two-space indentation. Also, I think find it better if the watchList variable is on the same line of the
var averageRating = watchList // Use filter to find films directed by Christopher Nolan .filter(film => film.Director === "Christopher Nolan") // Use map to convert their ratings from strings to numbers .map(film => Number(film.imdbRating)) // Use reduce to add together their ratings .reduce((sumOfRatings, rating) => sumOfRatings + rating) // Divide by the number of Nolan films to get the average rating / watchList.filter(film => film.Director === "Christopher Nolan").length;