It is obvious when you think about it but functions are objects in JavaScript. So a function can have members. e.g.
var f = function()
{
return 2;
}
f.g = function(x)
{
return x + f();
}
If I ran f.g(5); I’d get back 7.
It is obvious when you think about it but functions are objects in JavaScript. So a function can have members. e.g.
var f = function()
{
return 2;
}
f.g = function(x)
{
return x + f();
}
If I ran f.g(5); I’d get back 7.