First class functions
When language support first class functions, we can do following things:
- We treat functions as value and used them as data,
- Functions are no different than any other properties or variables.
- For example, we could define function as variable and pass them to another function, we could also returning function.
- By treating function as first class value, we could compose multiple functions to create new behaviour. (Functional composition)
Linked Notes:
Functional programming
From Wikipedia :
Functional programming is a programming paradigm — a style of building the structure and elements of computer programs — that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data