Is Javascript a Functional Programming Language? Is Javascript a Functional Programming Language? javascript javascript

Is Javascript a Functional Programming Language?


Repeating my own answer to a similar question,

There's no accepted definition of functional programming language.

If you define functional language as the language that supports first class functions and lambdas, then yes, JavaScript *is* a functional language.

If you also consider the factors like support for immutability, algebraic data types, pattern matching, partial application etc then no, JavaScript *is not* a functional language.


I'd encourage you to read the following related blog posts (and also the comments below them):


I would say that it is a multi-paradigm language.

EDIT: It's multi-paradigm and includes functional constructs.


if you stretch and twist the term "functional programming" to the point of philosophical discussions, this question may be open again. However, then you end up on the level of useful questions like "Is C++ really a programming language"?

The answer to your question on more daily level is "no".

Functional programming means that the program is conceptualized as a evaluation of a function, rather than a control flow. The code is a description of functions, and has no inherent concept of a control flow.

JavaScript has got a control flow and is conceptualized as a imperative language. From its design objective, it is clearly not a functional language.