Created
July 12, 2021 04:10
-
-
Save AnatoliyAkhmatov/206e0ba45038f0e0f0c4099aa4f33934 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 queryString = window.location.search; | |
const urlParams = new URLSearchParams(queryString); | |
// https://example.com/path/to/page?color=purple&size=M&size=L | |
urlParams.get('color') // purple | |
urlParams.getAll('size') // ['M', 'L'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment