You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Just to add that this is pretty much standard JS. For example:

    function Foo(x) { this.baz = x; }
    Foo.prototype.bar = function() { return this.baz; };
    
    var f = new Foo("Hello World");
    console.log(f.bar());  // prints "Hello World"
    function printer(fn) { console.log(fn()); }
    printer(f.bar); // prints 'undefined'
    
About

Avatar for Gordon @Gordon started