I\'ve got a JavaScript \"object\", built this way:
function foo() { this.length = 0; } foo.prototype.getLength = function() { return this.length; } ...
Simple:
if(!MyNamespace) MyNamespace = {}; MyNamespace.foo = function() { this.length = 0; }; MyNamespace.foo.prototype.getLength = function() { return this.length; };