Function is just another type of object in Javascript, so:
alert(tobealerted());
alerts the function result but:
alert(tobealerted);
alerts the function object itself using .toString()
method which returns function's body for objects of type function
.
Statements like if
and so on are not objects but full definition of function declares an object. So you can alert function and not if
statement for example.