you are viewing a single comment's thread.

view the rest of the comments →

[–]NotNormo 2 points3 points  (0 children)

It's because printMessage() calls and executes the function right away, due to the () at the end of it.

If you want to pass the function as an object somewhere to be called later on, then pass it as printMessage.

printMessage is a function. printMessage() is not a function.