Just to kick a long-dead horse, because I've had to implement an optional argument in the middle of two or more required arguments. Use the arguments
array and use the last one as the required non-optional argument.
my_function() {
var options = arguments[argument.length - 1];
var content = arguments.length > 1 ? arguments[0] : null;
}