I'm trying to understand something fairly simple I hope. How to pass optional parameters to a function or object in javascript by the parameter name.
for instance, what script.aculo.us does with their scripts.
syntax example:
Sortable.create('id_of_container',[options]);
live example:
Sortable.create('examplelist',{ghosting:true,constraint:false})
the object has a possibility of 5-10 parameters, all of which have default values, but when you create the object/call the function, you can specify the parameter by name, and pass a different value.
I realize script.aculo.us uses the prototype framework, but I don't quite understand their documentation on all of it. (I'm new it OO javascript).
Any help would be appreciated in either the idea of calling a function and passing optional parameters by name, or even how to use the prototype framework to make an object that has that functionality.