I have this code.
function coolStuff( name , options ) {
this.name = name;
this.options = options;
this.children = $(name).children();
this.children.each( function( index, value ) {
//How can I call this.processMoreCoolStuff if im using multiple instance?
this.processMoreCoolStuff( {} );
});
this.processMoreCoolStuff = function( param ) {
//Some processing of this.options here!
}
}
var coolStuffObj01 = new coolStuff( "#cs01", {} );
var coolStuffObj02 = new coolStuff( "#cs02", {} );
How can I call this.processMoreCoolStuff() if im using multiple instance? What is the best approach for this?
eachcallback function,thisrefers to the jQuery element not thecoolStufffunction.