-
-
Save WesleySmits/652968a2b0caf891e2b4a1cc1cb09af3 to your computer and use it in GitHub Desktop.
URL Object: Reading Information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const url = new URL('https://medium.com/@WesleySmits?foo=bar#test'); | |
console.log(url.hash); // '#test' | |
console.log(url.search); // '?foo=bar' | |
console.log(url.searchParams.get('foo')); // 'bar' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment