Day 10: Higher Order Functions Part 1
Lesson 0: Intro
We've spent some time looking at arrays (a lot) of time looking at functions. Now it's time to combine the two and really show you some magic.
Today we will look at some special functions that exist on arrays, they will allow you to process array data in creative and efficient ways. We will look at the following higher order functions:
forEach
sort
map
filter
find
findIndex
some
every
reduce
reduceRight
Some of these words will look familiar to you, like filter
and find
, but others might sound very odd, like map
and reduce
.
Your head might be spinning by the end of today but that's ok, this is conceptually quite a challenging part of the language but it's also one of the most power and satisfying aspects to use.
Let's take a look at forEach
and use that as the proving ground for explaining the concept to you.