Автор: Cristian Salcescu
Издательство: Amazon.com Services LLC
Год: 2020
Страниц: 160
Язык: английский
Формат: pdf, azw3, epub
Размер: 10.1 MB
Functional programming is becoming more popular and this book aims to bring clarity on how to use jаvascript as a functional language. It turns out that jаvascript has everything it needs to be used as a functional language. We just need to remove features from the language. In essence, we are going to remove the this keyword from our code. That means we are not going to use classes or methods using the this keyword. It also implies not using custom prototypes. Removing this has other benefits. This is the source of much confusion in jаvascript, mainly because it depends on how the function is invoked, not where the function is defined.
There are many situations where this points to an unexpected function context and that leads to bugs. By removing this all the related problems are gone. jаvascript is both a functional programming language and a prototype-based language. If we get rid of this , we are left with jаvascript as a functional programming language. That is even better. Functional programming makes code easier to read, understand, test, and debug.
Here are some of the things you will learn:
How to disable 'this' and enable immutable data objects using a linter
How to work with immutable objects and collections
How to do data transformations using core operations like filter, map, sort, or reduce
How to use statements like if and switch in a functional way
How to create pipelines and use currying to pass additional data
How to create and use functors and monads
How to work with promises and observables
Understand the Elm Architecture
Скачать Functional Programming in jаvascript