Created
December 2, 2019 03:12
-
-
Save compulim/f2a335af6078e0a001a9555b1058345c to your computer and use it in GitHub Desktop.
Turns location.search into a JS object
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 searchParams = Array.from(new URLSearchParams(location.search).entries()).reduce((result, [key, value]) => ({ ...result, [key]: value }), {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment