Created
October 30, 2019 14:27
-
-
Save almond-bongbong/54677352a8bdb66b558e2d8474bc56cc to your computer and use it in GitHub Desktop.
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 searchParams = location.search | |
.replace('?', '') | |
.split('&') | |
.map(pair => pair.split('=')) | |
.reduce((acc, [k, v]) => { | |
acc[k] = decodeURIComponent(v); | |
return acc; | |
}, {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment