Say I have Dog
.
function Dog(name) {
this.name = name;
}
I want to namespace some functions on it's prototype.
Dog.prototype.movement = {
this.run = this.name + 'is running',
this.jump = function() { console.log(this.name + 'is jummping');}
}
So that I can call it like:
var carl = new Dog('Car');
carl.movement.jump();
//Carl is jumping.