Skip to content

Instantly share code, notes, and snippets.

@leostera
Last active December 25, 2015 14:09
Show Gist options
  • Save leostera/6989578 to your computer and use it in GitHub Desktop.
Save leostera/6989578 to your computer and use it in GitHub Desktop.
var url = function (obj) {
var name = Object.keys(this).filter(function (k) {
return this[k] === obj;
}).join('');
return '?'+Object.keys(obj).map(function (key) {
return name+'['+key+']='+obj[key];
}).join('&');
}.bind(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment