Know that a function is a first-class object in functional programming languages and in imperative programming languages that support such objects. This means that it can be an argument to another function as well as the result of a function call.
When calling a function, the name given to a type of object which can be passed in or returned is first-class object.
A first class object is any object / value which may:
- appear in expressions
- be assigned to a variable
- be assigned as arguments
- be returned in function calls
- Integer
- Floating-point values
- Characters
- Strings
In functional languages, functions are treated as first class objects.
This is what enables ideas such as currying and partial application to become reality.