From the course: Learning Functional Programming with JavaScript ES6+
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
First-class functions - JavaScript Tutorial
From the course: Learning Functional Programming with JavaScript ES6+
First-class functions
- [Instructor] The third major concept of functional programming is something called first-class functions. This is where things really start to get interesting and where the power and flexibility of functional programming really starts to shine through. So what exactly do we mean when we talk about first-class functions? Well, in object-oriented programming, we generally treat data and functions as different types of entities. We would probably never think of, for example, creating an array of functions or passing functions as arguments to other functions, or even stranger, returning functions from other functions. However, in functional programming, it's not only possible to do these things, it's in fact a source of tremendous flexibility. This is exactly what we mean when we say that a language supports first-class functions. It allows us to treat functions in a very similar way to how we normally treat other values such as numbers, strings, and objects. But hold on a minute…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
The goal of functional programming3m 38s
-
(Locked)
Declarative vs. imperative programming2m 46s
-
(Locked)
Immutability4m 18s
-
(Locked)
Separation of data and functions1m 47s
-
(Locked)
Object oriented to functional approach3m 29s
-
(Locked)
First-class functions2m 33s
-
(Locked)
Ensuring immutability: ESLint3m 14s
-
(Locked)
Ensuring immutability: Install ESLint1m 14s
-
(Locked)
Ensuring immutability: Finalize ESLint2m 27s
-
(Locked)
-
-
-
-
-