160
rated 0 times
[
163]
[
3]
/ answers: 1 / hits: 39698
/ 13 Years ago, tue, february 14, 2012, 12:00:00
I was looking for a constructor or a init function for following situation:
var Abc = function(aProperty,bProperty){
this.aProperty = aProperty;
this.bProperty = bProperty;
};
Abc.prototype.init = function(){
// Perform some operation
};
//Creating a new Abc object using Constructor.
var currentAbc = new Abc(obj,obj);
//currently I write this statement:
currentAbc.init();
Is there a way to call init function when new object is initialized?
More From » oop