Function.arguments

JavaScript 1.1+, JScript 1.0+ Nav3+, NES2+, IE 3+, Opera3+ Syntax

							function.arguments

Description

The arguments property of the Function object is an array that holds the arguments that are passed to a function. The number of arguments passed to a defined function can be more than the number of parameters if the arguments array is used. The arguments array can only be accessed while inside the function. Any attempt to access the arguments array outside the function will result in an error.

Example

Listing 6.126 shows how the arguments array is used. A document.write is performed, which calls the foo function. The foo function is passed two arguments and calls the foobar function with the parameter 123. The foobar function ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.