I\'ve got a JavaScript \"object\", built this way:
function foo() { this.length = 0; } foo.prototype.getLength = function() { return this.length; } ...
Shouldn't be much different:
namespace.foo = function foo() {...} namespace.foo.prototype.getLength = function() { ... }
or you could use
(function() { function foo() { ... } foo.prototype... namespace.foo = foo; })();
to save some typing.