Created
July 15, 2015 09:57
-
-
Save s-melnikov/ebf7e98d1f426450befe to your computer and use it in GitHub Desktop.
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
| function query(obj) { | |
| var str = ""; | |
| for (var prop in obj) { | |
| str && (str += "&") || (str = "?"); | |
| if (obj.hasOwnProperty(prop)) str += prop + "=" + obj[prop]; | |
| } | |
| return str; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment