stance]() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/@@hasInstance)
    2. [ ` Function.prototype.apply() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply)
    3. [ ` Function.prototype.bind() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind)
    4. [ ` Function.prototype.call() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call)
    5. [ ` Function.prototype.toString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/toString)
  6. **Inheritance**
  7. **[ ` Object ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) **
  8. Properties 
    1. [ ` Object.prototype.constructor ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor)
    2. [ ` Object.prototype.__proto__ ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto) Deprecated 
  9. Methods 
    1. [ ` Object.prototype.__defineGetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__) Deprecated 
    2. [ ` Object.prototype.__defineSetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineSetter__) Deprecated 
    3. [ ` Object.prototype.__lookupGetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupGetter__) Deprecated 
    4. [ ` Object.prototype.__lookupSetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupSetter__) Deprecated 
    5. [ ` Object.prototype.hasOwnProperty() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)
    6. [ ` Object.prototype.isPrototypeOf() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf)
    7. [ ` Object.prototype.propertyIsEnumerable() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable)
    8. [ ` Object.prototype.toLocaleString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toLocaleString)
    9. [ ` Object.prototype.toString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString)
    10. [ ` Object.prototype.valueOf() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)

##  In this article

  * Try it 
  * Value 
  * Description 
  * Examples 
  * Specifications 
  * Browser compatibility 
  * See also 

#  Function: length

The **` length ` ** data property of a [ ` Function ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Function) instance indicates
the number of parameters expected by the function.

##  Try it

##  Value

A number.

Property attributes of ` Function: length `  
---  
Writable  |  no   
Enumerable  |  no   
Configurable  |  yes   
  
##  Description

A [ ` Function ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Function) object's ` length `
property indicates how many arguments the function expects, i.e. the number of
formal parameters. This number excludes the [ rest parameter ](/en-
US/docs/Web/JavaScript/Reference/Functions/rest_parameters) and only includes
parameters before the first one with a default value. By contrast, [ `
arguments.length ` ](/en-
US/docs/Web/JavaScript/Reference/Functions/arguments/length) is local to a
function and provides the number of arguments actually passed to the function.

The [ ` Function ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Function) constructor is
itself a ` Function ` object. Its ` length ` data property has a value of ` 1
` .

Due to historical reasons, ` Function.prototype ` is a callable itself. The `
length ` property of ` Function.prototype ` has a value of ` 0 ` .

##  Examples

###  Using function length

js

    
    
    console.log(Function.length); // 1
    
    console.log((() => {}).length); // 0
    console.log(((a) => {}).length); // 1
    console.log(((a, b) => {}).length); // 2 etc.
    
    console.log(((...args) => {}).length);
    // 0, rest parameter is not counted
    
    console.log(((a, b = 1, c) => {}).length);
    //