What is the best way to create a function that takes optional arguments in nodejs?
for example I know this method:-
function optionalArguments(a,b){
var a = a || nothing;
var b = b || nothing;
}
but in this case if I do this :
optionalArguments(false,false)
both a and b return nothing although I have passed an argument.
and also I get unexpected token error when I call the function like this :
optionalArguments(,xxx);
Is there a better or a standard method to tackle optional arguments in nodejs?
Any help is appreciated.
Thanks in advance.