so I have an object Obj with some methods. If the object is called without any method I would like to run a specific method. Is that possible? If so how?
e.g.
function obj(variable){
this.method = function(){};
this.noMethod = function(){};
}
var test = new obj(variable);
Calling console.log(test) should now call noMethod on test.
I hope you get what I mean.
The object has a nodelist if you call a method, it runs the method. If you just call the object it should return the nodelist and possible alter it, depending on the argument.
Is there maybe a way to check if the object is called with a method? This way I could have an if-Statement to check and run my method if no other method is called.