Below is the code snippet I am trying to implement:
function A(){
this.init.apply( this, arguments );
}
A.prototype = {
name: "",
init: function( nameOfSomething ){
this.name = nameOfSomething;
}
};
This setup allows me to do the following:
var something = new A();
Now, I am looking to include another class within the "A" class. Let's call it B.
What I aim to achieve is:
something.B = new B();
something.B.name = "testing";
I envision that B will have various properties and methods that can be customized!
Any insights or suggestions are appreciated!