In Express.js, the :id? in a route path like "/users/:id?" denotes that id is a(n) ______ parameter.

  • optional
  • required
  • query
  • body
In Express.js, the :id? in a route path like "/users/:id?" denotes that id is an optional parameter. This means that the id parameter may or may not be present in the URL, and the route will still match. The other options are not correct in this context (required would mean the parameter is mandatory, query is used for query parameters, and body is used for request bodies).
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *