ELI5: Explain Like I'm 5

Map (higher-order function)

Okay kiddo, so imagine you have a box of toys with a bunch of different things inside, like balls, blocks, and stuffed animals.

Sometimes you might want to do the same thing to all of the toys - like putting them all away in a bin. That's kind of like using a "map" function.

A "map" function is a special kind of tool that can take a bunch of things, like toys or numbers or words, and do the same thing to each one. Instead of doing the same action manually over and over again for each toy, you can use the "map" function to do it all at once.

For example, you could use the "map" function to put every toy away in a bin by saying "take each toy and put it in this bin." The "map" function does the same thing to each toy (putting it away) without you having to tell it to do it over and over again.

It's like having a magic wand that can do the same thing to a bunch of things at once - pretty cool, right?