new URL('https://a.com').href // β 'https://a.com/'href returns the full normalized URL string including trailing slash.
JSON.stringify() calls toJSON() on objects that have it. This means a URL inside an object serializes to its string form automatically.
Challenge: Verify that JSON.stringify({ endpoint: url }) serializes the URL correctly.