3 ms·
First class functions are only one aspect of functional programming. Immutaility is a core feature which has only recently seen popular adoption in JS, with pro
by jahewson 11y ago
First class functions are only one aspect of functional programming. Immutaility is a core feature which has only recently seen popular adoption in JS, with projects such as immutable.js. Out of the box JS doesn't offer the data structures necessary to code naturally in a Scheme-like manner.
Couple this with the new concept of Virtual DOM as pioneered in React and you get purely functional UI on the web, a radical departure from the status quo of just a few years ago. Defintely a new development for JS. Indeed, React Native suggests that this could be an important development for UI in general.
- kyllo 11y agoExactly. Vanilla JS (and JQuery and friends) have the semantics of mutating a tree (the DOM) in-place. A key differentiator of these functional libraries is the immutable data structure semantics.