how router object of express.js is parsed to app.use() which accept callbacks only as router is an object of express , I want to understand why app.use() is not throwing an error even if router is a object and app.use() demands callbacks?
Callback functions; can be:
- A middleware function.
- A series of middleware functions (separated by commas).
- An array of middleware functions.
A combination of all of the above.
appimplement the middleware interface, you can use them as you would any other middleware function.
(my emphasis at the end)
So that’s the answer. Both