While this doesn't exist in JS out of the box, I can think of two options in addition to the other answers, that actually mimick the feature you are looking for.
a. CoffeeScript
Among other cool features, CS supports default function values:
var classReplace = (object, newClass, originalClass = "") ->
console.log(originalClass)
Of course this just gets interpreted as:
var classReplace = function(object, newClass, originalClass) {
if (originalClass == null) {
originalClass = "";
}
return console.log(originalClass);
};
But still nice to have for readability, and like I said, CS has a lot of other cool features, may be worth a look.
b. Lo-Dash's partialRight method. (link)
usage:
var originalFunction = function(a,b) { return a + b; },
functionWithDefaultValues = _.partialRight(originalFunction, 1, 2);
jsfiddle
notes:
_.partial, for some reason, doesn't have the same behaviour.
_.partialRight appends the values from the right, so in the above, the default value for b is 1.
Hope this helps.