From 3c5ae76e7c7fedba44702aa121cb94677bc4a32f Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Fri, 23 Dec 2022 09:57:55 +0900 Subject: [PATCH] Address reviewer's comment --- doc/api/url.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/api/url.md b/doc/api/url.md index f352fb5656e473..3f8bc1d80d9661 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -251,15 +251,15 @@ const myURL = new URL('https://example.org:81/foo'); console.log(myURL.hostname); // Prints example.org -// Setting an invalid hostname is ignored: -myURL.hostname = 'example.com:82'; +// Setting the hostname does not change the port +myURL.hostname = 'example.com'; console.log(myURL.href); -// Prints https://example.org:81/foo +// Prints https://example.com:81/foo // Use myURL.host to change the hostname and port -myURL.host = 'example.com:82'; +myURL.host = 'example.org:82'; console.log(myURL.href); -// Prints https://example.com:82/foo +// Prints https://example.org:82/foo ``` Invalid host name values assigned to the `hostname` property are ignored.