Skip to content

Instantly share code, notes, and snippets.

@cray0000
Created May 29, 2013 04:51
Show Gist options
  • Save cray0000/5668031 to your computer and use it in GitHub Desktop.
Save cray0000/5668031 to your computer and use it in GitHub Desktop.
hasParam JS
var toParam,
__hasProp = {}.hasOwnProperty;
toParam = function(object) {
var key, params, val;
params = [];
for (key in object) {
if (!__hasProp.call(object, key)) continue;
val = object[key];
params.push("" + key + "=" + val);
}
return params.join('&');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment