Skip to content

Instantly share code, notes, and snippets.

@Zielak
Created August 10, 2018 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zielak/1f8bbd346ac90aacf2efdf508a8ec9c0 to your computer and use it in GitHub Desktop.
Save Zielak/1f8bbd346ac90aacf2efdf508a8ec9c0 to your computer and use it in GitHub Desktop.
Get things from url after `?` and turn it into an object.
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