Daniel's working notes

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: