Functions as Object
Function is a special type of object in JavaScript.
The constructor of the function is an Object.
In the above example 1 we declared a function welcome. We can print "Welcome"
by calling as welcome();
. Instead we can also use call()
and apply()
methods to call the same function. We know that Object
only has the key values
. Now clearly understood that function is also an Object.
Last updated