Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two examples of URL() constructor #10990

Merged
merged 2 commits into from
Dec 6, 2021
Merged

Conversation

aleen42
Copy link
Contributor

@aleen42 aleen42 commented Dec 6, 2021

Summary

Add two examples of URL Constructor according to mdn/browser-compat-data#13820.

Motivation

To tell readers an edge case when passing empty string value to the first argument.

Supporting details

// Chrome, Firefox, Node, New Edge
new URL('', 'http://www.test.com?sid=1').searchParams.get('sid'); // => "1"
// Old Edge
new URL('', 'http://www.test.com?sid=1').searchParams.get('sid'); // => null

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@aleen42 aleen42 requested a review from a team as a code owner December 6, 2021 02:04
@aleen42 aleen42 requested review from Rumyra and removed request for a team December 6, 2021 02:04
@github-actions github-actions bot added the Content:WebAPI Web API docs label Dec 6, 2021
@sideshowbarker
Copy link
Collaborator

Aleen, thanks much, and congrats on landing your first docs change here — welcome aboard 🎉

@sideshowbarker sideshowbarker merged commit cf060bb into mdn:main Dec 6, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2021

Preview URLs

Flaws

None! 🎉

External URLs

URL: /en-US/docs/Web/API/URL/URL
Title: URL()
on GitHub

No new external URLs

(this comment was updated 2021-12-06 03:59:50.362909)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants