JS Built-ins
← URL10 / 20
URLadvanced

URL Properties β€” searchParams live round-trip

πŸ“– Usage Example
const u = new URL('https://example.com')
u.origin  // β†’ 'https://example.com'

origin combines the protocol and host without path, search, or hash.

URL Instance Properties β€” searchParams (live)

url.searchParams is a live URLSearchParams object. Mutating it propagates back to url.href (and url.search).

Challenge: Mutate url.searchParams and verify url.href reflects the change.

πŸ’‘ Hints (1)
  • β€’ url.searchParams is a live view β€” changes to it are reflected in url.href immediately