@thom Because adding methods to Foo.prototype only makes sense if you're going to use those methods later. You create instances of Foo like so: var foo1 = new Foo(); and then call the prototype methods on those instances: foo1.blah(). If Foo is not a function, you cannot make instances of it, so having a prototype object is pointless.
Foo.add_function('blah', function() { ... });instead of this:Foo.prototype['blah'] = function() { ... };?Foo.prototypeonly makes sense if you're going to use those methods later. You create instances ofFoolike so:var foo1 = new Foo();and then call the prototype methods on those instances:foo1.blah(). IfFoois not a function, you cannot make instances of it, so having aprototypeobject is pointless.prototypeis a property of a function. Things that aren't functions do not have aprototypeproperty.