const u = new URL('/path', 'https://example.com')
u.href // β 'https://example.com/path'Pass a base URL as the second argument to resolve relative URLs.
new URL(relative, base) resolves a relative path against a base URL.
Challenge: Use new URL('/path', 'https://example.com') and check the pathname and href.