Created
February 1, 2018 14:55
-
-
Save wholypantalones/377a89e38af0163d6a7d49a7ddba4e91 to your computer and use it in GitHub Desktop.
Convert object to params
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
/* params = {paramOne: '1', paramTwo: '2'} */ | |
var str = Object.keys(params).map(function(key) { | |
return key + '=' + encodeURIComponent(params[key]); | |
}).join('&'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment