JavaScript has been a multi-paradigm programming language since its inception back in 1995. It allows us to take advantage of an object-oriented programming style, but it also allows us to take advantage of a functional programming (FP) style. The same can be said about TypeScript. However, TypeScript is even better suited to FP than JavaScript because, as we will learn in this chapter, static type systems and type inference are very important in FP languages, such as the ML family of programming languages.
The JavaScript and TypeScript ecosystems have experienced a significant increase in interest in FP over the last 3 or 4 years. I believe that the cause of this increase in interest is the success of React. React is a library used to build user interfaces developed by Facebook, which is highly influenced by some core FP concepts.
We will...