What is the most efficient way of reading optional attributes in an optional setting argument. I'm using something like:
f = func(var1, optionalsettings) {
var2 = (optionalsettings === undefined ? 0
: (optionalsettings['var2'] == null ? 0 : optionalsettings['var2']));
};
But I've the feeling it can be done more efficiently, either in javascript or in jquery.