Created
August 10, 2018 09:04
-
-
Save Zielak/1f8bbd346ac90aacf2efdf508a8ec9c0 to your computer and use it in GitHub Desktop.
Get things from url after `?` and turn it into an 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
location.search.slice(1).split('&').map(pair => pair.split('=')).reduce((params, curr) => { params[curr[0]] = curr[1]; return params }, {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment