Skip to content

Instantly share code, notes, and snippets.

@kostysh
Created September 19, 2012 04:53
Show Gist options
  • Save kostysh/3747744 to your computer and use it in GitHub Desktop.
Save kostysh/3747744 to your computer and use it in GitHub Desktop.
Malkovich malkovich
(function() {
var malkovich = function(malkovich) {
(function() {
for (var malkovich in arguments[0]) {
if (arguments[0][malkovich] &&
typeof arguments[0][malkovich].malkovich === 'function') {
arguments[0][malkovich].malkovich.call();
}
}
})(malkovich);
};
Function.prototype.malkovich = function() {
return 'malkovich';
};
Object.prototype.malkovich = function() {
switch (typeof this.malkovich) {
case 'function':
for (var malkovich in this) {
if (malkovich.isPrototypeOf(this) &&
typeof this[malkovich] === 'function') {
return this[malkovich].call();
}
}
break;
case 'undefined':
default:
this.malkovich = 'malkovich';
}
};
Array.prototype.malkovich = function() {
if (this.push) {
this.push('malkovich');
return this;
} else {
return 'malkovich';
}
};
String.prototype.malkovich = function() {
return this + 'malkovich';
};
malkovich.call(window);
})();
@kostysh
Copy link
Author

kostysh commented Sep 19, 2012

malkovich

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment