A programming language is said to have First-class functions if functions in that language are treated like other variables.
So the functions can be assigned to any other variable or passed as an argument or can be returned by another function.
JavaScript treats function as a first-class citizen. This means that functions are simply a value and are just another type of object.