Skip to content

Instantly share code, notes, and snippets.

@xulapp
Created March 12, 2010 07:51
Show Gist options
  • Save xulapp/330137 to your computer and use it in GitHub Desktop.
Save xulapp/330137 to your computer and use it in GitHub Desktop.
__call__ in JavaScript
function Callable() {
var self = function Callable()
this.__call__.apply(this, arguments);
self.__proto__ = Callable.prototype;
return self;
}
Callable.prototype = {
constructor: Callable,
__proto__: Function.prototype,
__call__: function __call__() {
},
};
@ackvf
Copy link

ackvf commented Jan 21, 2021

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