For example, in test.js this is allowed (and extremely pointless):
1 + 2;
(function () {});
When executing with node:
$ node test.js
$
The form function () {} (without parentheses) is allowed in other contexts, for example as an argument to another function.
Why is not the following allowed in the top level of a JavaScript file?
function () {};