Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Advanced JavaScript

You're reading from   Advanced JavaScript Speed up web development with the powerful features and benefits of JavaScript

Arrow left icon
Product type Paperback
Published in Jan 2019
Publisher
ISBN-13 9781789800104
Length 330 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Zachary Shute Zachary Shute
Author Profile Icon Zachary Shute
Zachary Shute
Arrow right icon
View More author details
Toc

Higher Order Functions


As we learned in the first topic, a higher order function is a function that either takes another function in as an input argument or returns another function as the return value. Nearly all asynchronous code in JavaScript makes use of higher order functions by passing callback functions in as input arguments. Aside from their prolific use in JavaScript, higher order functions are a key part of Functional Programming and are used for three key benefits: abstraction, utilities, and complexity reduction.

Higher order functions are very important for abstraction. Abstraction is a way to hide the internal workings or details of a procedure. For example, consider the process of cooking a meal from a recipe. A recipe may require you to chop a food item. What is chopping? It is an abstraction of an action. The action and steps to complete the action are to take a knife, place it over the food item, and press downward. Then, move the knife a short distance along the food item...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image