Express JS Study Guide 2026
Everything you need to pass the Express JS exam in one place: the exam format, every topic to study, real practice questions with explanations, flashcards, and full-length practice tests. Free, no sign-up needed.
📋 Express JS Exam Format at a Glance
📚 Express JS Topics to Study (23)
✍️ Sample Express JS Questions & Answers
1. What is the recommended way to handle async errors in Express 5?
Express 5 natively handles rejected promises in route handlers and middleware, automatically forwarding them to error handlers.
2. What type of middleware runs for every route regardless of path or method?
Calling app.use() without a path argument applies the middleware to every incoming request.
3. How do you set a cookie on the response in Express?
res.cookie() sets a cookie with the specified name and value, with optional options like maxAge, httpOnly, and secure.
4. In Pug templates, which keyword includes another Pug file into the current template?
The 'include' keyword in Pug inserts the contents of another template file at that position, enabling template composition.
5. Which method sets the HTTP status code of a response in Express?
res.status() sets the HTTP status code for the response and returns the response object for chaining.
6. What does req.fresh return in Express?
req.fresh checks Last-Modified and ETag headers to determine if the cached response is still valid (HTTP 304 logic).