Higher-order functions in JavaScript allow developers to organize and compose their code in many different and flexible ways. The reason why higher-order functions are even a possibility in the language is that functions are treated just like any other values like strings and arrays.
A higher-order function is a method that either takes in another method as an argument or returns a method. Because of these two attributes, higher-order functions make it possible for developer to not only abstract values (avoiding repeated values) but also actions (avoid repeated actions).
In this video, I'll show you why it's important to understand and use higher-order functions by walking you through an example where we refactor our code to use the function. On top of that, I'll walk you through reimplementing the popular array map() method so you get a better understanding of how the method works under the hood.
🎬 Subscribe to the channel! - / @ijemmaonwuzulike
Timestamps:
0:00 Intro
0:43 What is a Higher-Order Function?
1:18 Higher-Order Function Examples
3:04 The Importance of Higher-Order Functions
4:22 Refactor Code with Higher-Order Functions
5:28 Reimplement the map (Higher-Order) Method
7:16 How to use Callbacks
== Let's Connect ==
🐦 Twitter - / ijemmaohno
== Who I Am ==
I'm Ijemma, a frontend software engineer currently working in New York City. I make videos on all things JavaScript and, more broadly, frontend web development.
#javascript #webdevelopment #softwareengineer
5 июл 2024