Tag Archives: art

javascript constructor with arguments

There was an interesting question on stackoverflow recently. Nobody had right answer. Now after few days i got it! It is really a peace of JS art. The question was if it is possible to call constructor like this: someClass(arg1,arg2,...,argN){ .... //implementation } having just an Array of arguments [arg1,arg2,...,argN]. First thought was just to use apply. Next was: how [...]
Posted in post | Also tagged | Leave a comment