Just curious. Is there a simpler/better way to write the following code? I need just two arguments options and callback. The function may be called without any argument, with just callback, or with an options hash and callback.
function () {
if (typeof arguments[0] === "function") {
callback = arguments[0];
} else if (arguments[0] && typeof arguments[0] === "object" && typeof arguments[1] === "function") {
options = arguments[0];
callback = arguments[1];
}
...
...
}