Function.prototype.length

The number of parameters expected by the function.

Syntax

length

Example

function sum(a, b) {
    return a + b
}
sum.length
2