I'm working on trying to build a small library of functions within an object prototype. I'd perviously just been throwing my helper functions as global functions, however i'm trying to migrate to something more self contained.
Anyway my proto wrapper looks like this;
Q.fn = jHelper.prototype = {
// helper functions
addClass: function() {}, //...
removeClass: function() {}, //...
// etc..
// I want to add a child prototype method here that can be called
Parent: function() {
child: function(args) {
console.log(args);
}
}
}
Q.Parent.child("test");
The problem is that I can't call functions inside "Parent". How do set this up so I can add child functions as a prototype of "Parent"?