Created
January 20, 2017 15:14
-
-
Save MartinMuzatko/69930f5731bb160c9b59b9575517744e to your computer and use it in GitHub Desktop.
GET Params in JS as Object
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
// 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