Skip to content

Commit

Permalink
docs(url): fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanyf committed Apr 10, 2024
1 parent cbf0de0 commit 9195d65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ let url = new URL('https://example.com');

```javascript
const url1 = new URL('page2.html', 'http://example.com/page1.html');
url2.href // "http://example.com/page2.html"
url1.href // "http://example.com/page2.html"

const url2 = new URL('..', 'http://example.com/a/b.html')
url3.href // "http://example.com/"
url2.href // "http://example.com/"
```

这种写法很方便基于现有网址,构造新的 URL。
Expand Down

0 comments on commit 9195d65

Please sign in to comment.