Skip to content

Instantly share code, notes, and snippets.

@MartinMuzatko
Created January 20, 2017 15:14
Show Gist options
  • Save MartinMuzatko/69930f5731bb160c9b59b9575517744e to your computer and use it in GitHub Desktop.
Save MartinMuzatko/69930f5731bb160c9b59b9575517744e to your computer and use it in GitHub Desktop.
GET Params in JS as Object
// location.search = '?a=b&c=d&limit=20'
var get = new Map(location.search.substr(1).split('&').map((pair)=>{return pair.split('=')}))
// get = {a:'b', c:'d', limit: 20}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment