I have a bunch of jQuery objects with a init method, so right now I have something like this
$.myobject1.init(somevar);
$.myobject2.init(somevar);
$.myobject3.init(somevar);
$.myobject4.init(somevar);
$.myobject5.init(somevar); // somevar is the same var in all the calls
but I'm looking for a way to simply this code, something like this
var objectName = "myobject1"; // or any other object name
$. objectName .init(somevar);
thanks for the help! :-)