Created
July 11, 2013 13:34
-
-
Save ryoppy/5975477 to your computer and use it in GitHub Desktop.
オブジェクトをアルファベット順でGETパラメータに変換 ref: http://qiita.com/ryoppy@github/items/4373bba239ae7320181f
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
var obj = {b: 1, a: 3, c:2}; | |
_.map(_.keys(obj).sort(), function(key) { | |
return key + '=' + obj[key]; | |
}).join('&'); | |
// a=3&b=1&c=2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment