The fact that JavaScript is not a strongly typed language allows developers a lot of freedom, but that freedom can turn into giving you enough rope to hang yourself.
Specifically, it is syntactically acceptable to invoke any expression as though its value were a function. But a TypeError may be
raised if you do.
foo = 1; foo(); // Noncompliant; TypeError foo = undefined; foo(); // Noncompliant; TypeError