Why are functions first-class objects?
JavaScriptFunctions as first-class objects
In JavaScript, functions are first-class objects, because they can be treated like any other variable.
- They can be assigned to variables.
- They can be properties of an object called methods.
- They can be item in array.
- They can be passed as arguments to a function.
- They can be returned as values of a function.
00:00