Is JavaScript functional?
At about this time, there is another important question that you should be asking: is JavaScript a functional language? Usually, when thinking about FP, the list of languages that are mentioned does not include JavaScript, but does include less common options, such as Clojure, Erlang, Haskell, and Scala; however, there is no precise definition for FP languages or a precise set of features that such languages should include. The main point is that you can consider a language to be functional if it supports the common programming style associated with FP. Let’s start by learning about why we would want to use JavaScript at all and how the language has evolved to its current version, and then see some of the key features that we’ll be using to work in a functional way.
JavaScript as a tool
What is JavaScript? If you consider popularity indices, such as the ones at www.tiobe.com/tiobe-index/ or pypl.github.io/PYPL.html, you’ll find that...