All quizzesMedium
HTTP Servers & APIs
Preview — 3 of 10 questions
What is the proper way to handle errors in Express?
AThrow errors and let them crash the server.
BUse try/catch and send error responses.
CIgnore errors; they fix themselves.
DUse console.log to display errors.
What is the benefit of using async/await in Express routes?
AMakes code faster.
BAsync/await is not useful in Express.
CMakes code cleaner and easier to handle errors.
DOnly works for GET requests.
What are environment variables and why use them?
AVariables stored in JavaScript files.
BVariables for environment conditions like temperature.
CVariables that change based on user input.
DVariables stored outside code for configuration (database URL, API keys, etc.).
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.