Skip to content

Commit

Permalink
Address reviewer's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
deokjinkim committed Dec 23, 2022
1 parent e3553eb commit 3c5ae76
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/api/url.md
Expand Up @@ -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.
Expand Down

0 comments on commit 3c5ae76

Please sign in to comment.