Created
June 12, 2015 14:36
-
-
Save ehgoodenough/839dd2c85e5f78cf2f84 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
var generateURL = function(target, params) { | |
if(typeof target != "string") { | |
target = target.join("/") | |
} | |
if(typeof params != "string") { | |
params = Object.keys(params).map(function(key) { | |
return key + "=" + params[key] | |
}).join("&") | |
} | |
return target + "?" + params | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment