Hands-On Functional Programming with TypeScript
上QQ阅读APP看书,第一时间看更新

Functional Programming Fundamentals

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 (OOP) style along with a functional programming style. The same can be said of TypeScript. However, for functional programming, TypeScript is even better suited than JavaScript because, as we will learn in this chapter, static type systems and type inference are both very important features in functional programming languages such as the ML family of programming languages, for example.

The JavaScript and TypeScript ecosystems have experienced a significant increase in interest in functional programming over the last few years. I believe that this increase in interest can be attributed to the success of React. React is a library developed by Facebook for building user interfaces, and it is highly influenced by some core functional programming concepts.

In this chapter, we will focus on learning some of the most basic functional programming concepts and principles.

In this chapter, you will learn about the following:

  • The main characteristics of functional programming
  • The main benefits of functional programming
  • Pure functions
  • side-effects
  • Immutability
  • Function arity
  • Higher-order functions
  • Laziness