Skip to content

Instantly share code, notes, and snippets.

@steida
Created April 20, 2009 23:46
Show Gist options
  • Save steida/98844 to your computer and use it in GitHub Desktop.
Save steida/98844 to your computer and use it in GitHub Desktop.
Function.prototype.pleaseAcceptAsPairToo = function() {
var one = function(key, value) {
var obj = {};
obj[key] = value;
return many.call(this, obj);
}, many = this;
return function(item) {
return ((typeof item == 'string') ? one : many).apply(this, arguments);
};
};
Function.prototype.extend = function(object) {
for (var key in object) this[key] = object[key];
return this;
} .pleaseAcceptAsPairToo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment