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 '?'.
Parse 'https://user:pass@host.com:8080/path?q=1#hash' and inspect all its parts.
Challenge: Check username, port, pathname, search, and hash.