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:
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.
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.
Final Answer:
A URL that depends on a base URL to form a full address. -> Option B
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
Master "URL and Query String Handling" in Node.js
9 interactive learning modes - each teaches the same concept differently