Can someone explain this term for me and describe a typical programming situation where first-class functions are used? Thanks
We often hear that JavaScript functions are first-class functions, meaning both functions and objects are treated by the language as the same thing. In practical terms, a function can be stored as a variable, inside an array or an object, as well as it can be passed as an argument or be returned by another function. That makes functions “first-class citizens” in JavaScript.
These are the examples:
var myfunc2 = function(a)
{
return a + 1;
};
var myfunc2 = function myfunc4(a)
{
return a + 1;
};
Refer the following links
http://www.developerfusion.com/article/84433/first-class-functions/