Which Express.js function is used to create an instance of a router object?
- app.route()
- express.router()
- express.Router()
- app.useRouter()
In Express.js, you create an instance of a router object using express.Router(). Routers are used to modularize routes and middleware. The other options do not create router instances in the standard Express.js way.
Loading...
Related Quiz
- In JavaScript, the ______ method is used to iterate over all enumerable properties of an object.
- In JavaScript, objects created using object literal syntax are instances of ______.
- How can you determine the type of a variable in JavaScript?
- What is the main purpose of using 'describe' and 'it' blocks in Mocha?
- How can you allocate a buffer of a specified size without initializing it in Node.js?