const u = new URL('https://example.com?a=1')
u.searchParams.get('a') // β '1'searchParams gives a URLSearchParams object for convenient query string manipulation.
hash is the fragment including #. origin is protocol + hostname + port.
Challenge: Check hash and origin on various URLs.