Many people know that JS's syntax was planed to be alike Java. But a few ones know that its functionality (= Architecture) is based on Schema which itself is based on Lisp and Lisp is a functional language.
Although the concept of closures comes from functional programming languages, but JS (= JS developers) started to use it frequently in their code and slowly it shows the shiny part of JS for its usage in FP paradigm.
Also adding new features to the language specially ES6 (=2015) showed that FP part plays a great role into JS.
For Example Promises are based on Maybe Monads which is a FP concepts.
It does not mean that OOP is bed, is dead, etc, definitely we need it, but having FP concepts and techniques in our toolbox help us to solve our problems differently if it would be possible.
Before using JS, I wanted to learn FP using Kaskell and after one week I gave up because these were new to me:
- the syntax
- the concepts
- the techniques and idiom
Which makes it hard to forward these three at the same time for me that was familiar with C, and C++.
But with JS which its syntax is alike Java and Java is based on C++, it will be easier to learn concepts and techniques.
In these series of posts we review core concepts and techniques using bottom-up approach which means seeing the implementation and concepts at the same time rather than first talk about concepts (= mathematically) and do little or no code.
Follow this new series and if there were a mistakes in any cases, please notify me on github.
Update: Sun Oct 20 2019 08:38:22 GMT+0330 (Iran Standard Time)