|
|
|
|
|
by noonat
4836 days ago
|
|
If you want to allow undefined to be passed as a valid non-default value for a trailing parameter, you can also use arguments.length to determine how many arguments were explicitly specified. var foo = function(a, b) {
if (arguments.length < 2) {
b = 'some default value';
}
// ...
};
|
|