JavaScript and functional programming
Functional programming basically means using functions in a certain way to write a logical piece of code. Most languages allow functions to be really complex and hard to understand. Functional programming, however, puts constraints on functions in order to be able to compose them and mathematically prove something about their behaviour.
One of the constraints is the regulation of communication with the external world (for instance, side effects, such as data fetching). Some assert that no matter how many times we call a function with the same arguments, it will return the exact same value. All of these constraints will give us certain benefits. You can name some of these benefits already, such as time-traveling, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access