Function.length (Property)

The number of arguments expected by a function call.

Availability:

ECMAScript edition - 2
JavaScript - 1.1
JScript - 1.0
Internet Explorer - 3.02
Netscape - 4.0
Deprecated
Property/method value type:Number primitive
JavaScript syntax:-myFunction.length

This property yields a numeric value representing the number of arguments the function expects to be called with and can support.

The length property of the Function constructor returns 1 but it accepts a variable number of arguments.

Otherwise the length property returns a value that is typical for the function. Because the number of arguments can often be variable, this typical value should be used with caution.

This value is not necessarily the same as the length of the arguments array that is available inside the function when it is called. This indicates the actual number of arguments that were passed.

Warnings:

See also:Arguments.length, Function call, Function object, Function.arity, Function.prototype

Property attributes:

ReadOnly, DontDelete, DontEnum

Cross-references:

ECMA 262 edition 2 - section - 15.3.3.2

ECMA 262 edition 2 - section - 15.3.5.1

ECMA 262 edition 3 - section - 15.3.5.1