I need to create a dynamic object. I'll store all of these objects in an array. Each object will have some property and objects. After the object is created, I need to do an auto execute method from it. I can't call in my code like this: obj.doSomething because some users have 2 objects, and other users 300 objects.
Something like this:
class Select {
constructor(el,input){
this.el = el;
this.input = input
}
AutoExecture(){
// I need these function to execute immediately;
console.log(this.input);
}
}
this.AutoExecture()inside your constructor.