Argument (Definition)

A value passed to a function.

Arguments are passed to functions when they are called. They are substituted for the formal parameters in the function declaration.

Because JavaScript is weakly typed, you will need to implement any type checking you need for yourself.

You can compare the arity property of the owning function with the length property of the arguments array. If they are unequal, then the function was called with the wrong number of arguments.

You can then check the type of the arguments one by one to compare them against the expected types.

This is a lot of work for little gain unless it is an important aspect of your design.

See also:Arguments object, Arguments.length, Conversion, Definition, Function, function( ... ) ..., Function.arguments[], Parameter