What is the reason behind some middleware functions being passed in with invocation parentheses, while an anonymous function is passed in without being invoked?
app.use(logger());
app.use(bodyParser());
If logger()
is evaluated immediately and the return value gets passed into app.use()
, why doesn't app.use()
receive undefined
as the parameter?