Is this possible? I am creating a single base factory function to drive factories of different types (but have some similarities) and I want to be able to pass arguments as
what about a workaround?
function MyClass(arg1, arg2) { this.init = function(arg1, arg2){ //if(arg1 and arg2 not null) do stuff with args } init(arg1, arg2); }
So how you can:
var obj = new MyClass(); obj.apply(obj, args);