Search⌘ K
AI Features

Introduction to Functional Programming

Explore core concepts of functional programming such as pure functions, referential transparency, immutability, and higher-order functions. This lesson equips you with the foundational understanding needed to write predictable and maintainable code with functional techniques in TypeScript.

What is functional programming?

Functional programming is a style of programming that places functions at the forefront. This is similar to how object-oriented programming has classes at its core. This means that functions should be first-class citizens in functional programming. We’ve already encountered first-class citizens this lesson. However, to reiterate, it means that functions can be used and passed around as data. We can bind functions to variables, pass them as arguments to other functions, and return them from a function.

Note: The functions receiving or returning other functions are called higher-order functions.

Pure functions

Functional programming wants its functions to include ...