const myUrl = new URL('https://shop.example.com:8443/products/42?ref=email#reviews');
console.log(myUrl.protocol); // https:
console.log(myUrl.hostname); // shop.example.com
console.log(myUrl.port); // 8443
console.log(myUrl.pathname); // /products/42
console.log(myUrl.search); // ?ref=email
console.log(myUrl.hash); // #reviews