JS Built-ins
URLintermediate

URL Constructor β€” full URL parsing

πŸ“– Usage Example
new URL('https://x.com?a=1&b=2').search  // β†’ '?a=1&b=2'

The search property gives the raw query string including the leading '?'.

URL Constructor β€” full URL

Parse 'https://user:pass@host.com:8080/path?q=1#hash' and inspect all its parts.

Challenge: Check username, port, pathname, search, and hash.

πŸ’‘ Hints (1)
  • β€’ The URL constructor parses each component into a separate property