From the course: Learning Functional Programming with JavaScript ES6+
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Higher-order functions - JavaScript Tutorial
From the course: Learning Functional Programming with JavaScript ES6+
Higher-order functions
- [Instructor] All right, so we've spent quite a bit of time in previous videos talking about first-class functions in JavaScript, and we've seen how JavaScript treats functions in pretty much the same way as strings, numbers, objects, things like that, right? Other data types. Well, there's a term for functions that either take other functions as arguments or return functions, or as we're about to see, both are possible in the same function. We call these things higher-order functions. And I'm going to show you how to use them in this video. So first of all, let's start off by creating a new file. We'll just call this new file higher-order.js. All right, and inside this file, we're going to do the first demonstration of this. We're just going to see how this idea of higher-order functions can allow us to really separate the functionality out of certain functions in ways that we weren't able to do with a more procedural mindset. So here's what this is going to look like. We're going…
Contents
-
-
-
-
JavaScript arrow function syntax9m 15s
-
(Locked)
Using functions as data8m 52s
-
(Locked)
Creating arrays of functions6m 31s
-
(Locked)
Passing functions as arguments7m 47s
-
(Locked)
Returning functions10m 29s
-
(Locked)
Understanding closure8m
-
(Locked)
Higher-order functions8m 1s
-
(Locked)
Tour of CoderPad1m 29s
-
(Locked)
Solution: More higher-order functions2m 34s
-
-
-
-
-