Possible Duplicate:
What's the role of the parentheses in the following piece of code?
var dummy = (function (name) {return name;}(dummy || {}));
dummy.foo = ( function(s){
this.s = s;
return true;
}) ();
ok so I am not familiar with OO javascript but I know a little bit. Am I correct to say that this is the constructor for foo? what does the () do at the very end? also why is function(s){} in parentesis as well? there was some code in between but I took them out for simplicity sake. Would the above be the same as the below?
dummy.foo = function(s){
this.s = s;
return true;
};
I am trying to see what some code someone else wrote does and I don't have much experience in OO side so I am so confused as what's what. I can't even figure out which is the constructor