In JavaScript, there exists a function called "Function". When you create an instance of this function, it returns another function:
var myfunc = new Function('arg1','arg2','return arg1+arg2');
In the above example, the variable myfunc holds a function that adds two given parameters together.
It may seem puzzling that Function is itself a function. After all, how can something be an instance of itself? Additionally, the Object type is also a function and an instance of Function. This creates a loop where Function is an instance of Object, which in turn is an instance of Function. This relationship underscores that functions are objects themselves.
This may appear confusing at first glance, but realizing that functions are objects helps to clarify this seemingly infinite loop.
Thank you!