I know arguments.length
method , but this returns the number of arguments the function was called with.
What I need instead is the number of arguments that function requires, so for example
function myFunc(arg1,arg2,arg3) {
alert("number of passed args:" + arguments.length);
alert("number of required args:" + /*the code I'm asking for*/);
};
myFunc('some arg');
So myFunc() would return two alerts saying 1 and 3.
Any way to do that ?