4 ms·
Will someone give me a few concrete, practical examples of using functional programming in JavaScript? I'm interested in this concept, but I'm not sure how to
by hawkharris 13y ago
Will someone give me a few concrete, practical examples of using functional programming in JavaScript?
I'm interested in this concept, but I'm not sure how to go about applying it to my own work as a front-end web developer. Most of the resources online are theoretical.
- straws 13y agoEveryone using jQuery is benefitting from functional programming. Querying, traversing, and filtering are based on `each` and `map`. It turns what was formerly looping and saving values as temporary/instance variables into declarative, collection-based compositions of functions. Beyond that, Michael Fogus — big in the Clojure + Clojurescript community — has Functional Javascript which explores functional concepts using Underscore: http://www.amazon.com/Functional-JavaScript-Introducing-Programming-Underscore-js/dp/1449360726/ http://www.amazon.com/Functional-JavaScript-Introducing-Prog... Marijn Haverbeke — a big Lisp hacker and the creator of Codemirror — has a nice chapter in (the free!) Eloquent Javascript as well: http://eloquentjavascript.net/chapter6.html http://eloquentjavascript.net/chapter6.html You should also check out how Javascript supports functional programming in languages that compile to Javascript such as LiveScript or Elm. http://livescript.net/ http://livescript.net/ http://elm-lang.org/ http://elm-lang.org/
- dsego 13y agoCheck this out :) Christian Johansen - Pure, functional JavaScript http://vimeo.com/43382919 http://vimeo.com/43382919