Bird
0
0

Which of the following is a correct description of a relative URL in Node.js?

easy📝 Conceptual Q11 of 15
Node.js - URL and Query String Handling
Which of the following is a correct description of a relative URL in Node.js?
AA URL that includes the protocol and domain name.
BA URL that depends on a base URL to form a full address.
CA URL that always starts with 'http://' or 'https://'.
DA URL that cannot be resolved using the URL class.
Step-by-Step Solution
Solution:
  1. Step 1: Understand relative URL meaning

    A relative URL does not include the full path and depends on a base URL to form a complete address.
  2. Step 2: Compare options

    A URL that depends on a base URL to form a full address. correctly describes this. Options B and C describe absolute URLs. A URL that cannot be resolved using the URL class. is incorrect because Node.js URL class can resolve relative URLs with a base.
  3. Final Answer:

    A URL that depends on a base URL to form a full address. -> Option B
  4. Quick Check:

    Relative URL = depends on base URL [OK]
Quick Trick: Relative URLs need a base URL to become complete [OK]
Common Mistakes:
  • Confusing relative URLs with absolute URLs
  • Thinking relative URLs include protocol
  • Believing relative URLs cannot be resolved

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes