Created
April 20, 2009 23:46
-
-
Save steida/98844 to your computer and use it in GitHub Desktop.
This file contains 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.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