It's not possible to associate positional arguments in a function with key-value pairs in an object in general.
It is possible to configure a function to take arguments both ways:
myFunc = function (objOrA, b, c) {
var a = objOrA;
if (objOrA.a || objOrA.b || objOrA.c) {
a = objOrA.a;
b || (b = objOrA.b);
c || (c = objOrA.c);
}
return b;
};
If you have control over the function definition, however, the simplest solution is simply to require an object as the sole parameter no matter what.
myFunc = function (options) {
return options.b;
}