Skip to content

Instantly share code, notes, and snippets.

@WesleySmits
Created September 23, 2022 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WesleySmits/6d94da20453fac25720ba1b41ec4b360 to your computer and use it in GitHub Desktop.
Save WesleySmits/6d94da20453fac25720ba1b41ec4b360 to your computer and use it in GitHub Desktop.
URL Object: Construct URL Object
// Pass a full URL
const url = new URL('https://medium.com/@WesleySmits');
// Pass a path with the base URL as the second parameter
const url2 = new URL('@WesleySmits', 'https://medium.com/');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment