I’ll use the example from @m_hutley to demonstrate how map, filter, and reduce might be used in the real world.

Getting the average score of Tiger Woods is the objective in this case:

```
function averageScore(stats, player) {
const playerStats = stats.filter(function playerFilter(stat) {
return stat.player === player;
});
const playerScores = playerStats.map(function statScore(stat) {
return stat.score;
});
const totalScore = playerScores.reduce(function addScore(total, score) {
return total + score;
});
return totalScore / playerScores.length;
}
console.log(averageScore(stats, "Tiger Woods"));
```

The overall flow of the code can be make easier to understand by moving those functions

out:

```
function averageScore(stats, player) {
function playerFilter(stat) {
return stat.player === player;
}
function statScore(stat) {
return stat.score;
}
function total(total, score) {
return total + score;
}
const playerStats = stats.filter(playerFilter);
const playerScores = playerStats.map(statScore);
const totalScore = playerScores.reduce(total);
return totalScore / playerScores.length;
}
console.log(averageScore(stats, "Tiger Woods"));
```

Those functions can be replaced with arrow-notation instead, which helps to simplify things:

```
function averageScore(stats, player) {
const playerFilter = (stat) => stat.player === player;
const statScore = (stat) => stat.score;
const total = (total, score) => total + score;
const playerStats = stats.filter(playerFilter);
const playerScores = playerStats.map(statScore);
const totalScore = playerScores.reduce(total);
return totalScore / playerScores.length;
}
console.log(averageScore(stats, "Tiger Woods"));
```

And next up, I want to remove the playerStats/playerScores/totalScore variables, which in this case is best achieved just by having `scores`

variable.

```
function averageScore(stats, player) {
const playerFilter = (stat) => stat.player === player;
const statScore = (stat) => stat.score;
const total = (total, score) => total + score;
const scores = stats.filter(playerFilter).map(statScore);
return scores.reduce(total) / scores.length;
}
console.log(averageScore(stats, "Tiger Woods"));
```

That’s a good example of how filter/map/reduce are used in real-life projects. There are many other much more complex ways to use them, but ultimately they can help to make things easier to understand.