Skip to content

Higher-order functions are functions that operate on other functions, either by accepting them as arguments or by returning them as their results. This allows us to create an abstraction layer over actions, not just values.

Notifications You must be signed in to change notification settings

aozoragh/js-high-order-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

"# js-high-order-function" Higher-order functions are functions that operate on other functions, either by accepting them as arguments or by returning them as their results. This allows us to create an abstraction layer over actions, not just values.

The reason we can write higher-order functions in JavaScript is due to the fact that functions are values. This means they can be assigned to variables and passed as values. You might also often hear the term callback when referring to a function that is passed as an argument. This is due to it being called by the higher-order function. Callbacks are particularly common in JavaScript, with event handling, asynchronous code and array operations relying heavily on them.

The main advantages of this technique are abstraction, composition, code reusability and readability. Most of the 30 seconds of code snippets are built with higher-order functions in mind. They are small, easily digestible functions that are highly reusable and can be composed to create more complex logic.

About

Higher-order functions are functions that operate on other functions, either by accepting them as arguments or by returning them as their results. This allows us to create an abstraction layer over actions, not just values.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published