JavaScript as a Functional Language | Ajaxonomy | 2009 - 0 views
-
there is a little bit of hand-waving involved in calling JavaScript a functional language. JavaScript is not a side-effect free language, nor is it an expression-based language (i.e., it is not value-oriented, but rather variable-oriented). There is no tail call optimization in any of the current implementations, so recursion must be kept shallow. And the list goes on. Truth be told, JavaScript is really one of the first hybrid imperative-functional languages.
-
Higher-order functions allow us to do functional composition,
-
Since JavaScript does not have "overloaded" functions, this type of functionality is usually simulated using manipulation of the function's arguments. Currying comes in handy because it allows you to do this manipulation in a much cleaner and more modular way.
- ...1 more annotation...