Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 67e20f5

Browse filesBrowse files
recracktargos
authored andcommitted
doc: fix myUrl is not defined in url
Fixes a typo in the variable name in the URL code example in doc. Renames `myUrl` to `myURL` for consistency and readability. PR-URL: #46968 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
1 parent 774eb19 commit 67e20f5
Copy full SHA for 67e20f5

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎doc/api/url.md‎

Copy file name to clipboardExpand all lines: doc/api/url.md
+5-5Lines changed: 5 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -554,14 +554,14 @@ instance, the `URL` object will not percent encode the ASCII tilde (`~`)
554554
character, while `URLSearchParams` will always encode it:
555555

556556
```js
557-
const myUrl = new URL('https://example.org/abc?foo=~bar');
557+
const myURL = new URL('https://example.org/abc?foo=~bar');
558558

559-
console.log(myUrl.search); // prints ?foo=~bar
559+
console.log(myURL.search); // prints ?foo=~bar
560560

561561
// Modify the URL via searchParams...
562-
myUrl.searchParams.sort();
562+
myURL.searchParams.sort();
563563

564-
console.log(myUrl.search); // prints ?foo=%7Ebar
564+
console.log(myURL.search); // prints ?foo=%7Ebar
565565
```
566566

567567
#### `url.username`
@@ -1271,7 +1271,7 @@ console.log(urlToHttpOptions(myURL));
12711271
const { urlToHttpOptions } = require('node:url');
12721272
const myURL = new URL('https://a:b@測試?abc#foo');
12731273

1274-
console.log(urlToHttpOptions(myUrl));
1274+
console.log(urlToHttpOptions(myURL));
12751275
/*
12761276
{
12771277
protocol: 'https:',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.