Is Javascript a Functional Programming Language?

前端 未结 13 850
天涯浪人
天涯浪人 2020-12-04 05:22

Just because functions are first class objects, there are closures, and higher order functions, does Javascript deserve to be called a Functional Programming language? The

13条回答
  •  情深已故
    2020-12-04 05:45

    The term "functional programming" language is so overloaded these days it's almost useless. There are two dominant meanings:

    1. Has first-class functions
      • Javascript is this!
    2. Is based on functions as used in the lambda calculus, with an emphasis on avoiding persistent mutable state (often replacing it with parameters passed to functions)
      • As commonly written, Javascript is not remotely this!

    Pick your meaning and then the question is answerable.

提交回复
热议问题