Standard built-ins
Function.length
Number of formal parameters before the first default; rest is excluded and a destructuring pattern counts as one. Bound length is adjusted by leading arguments.
Formal Syntax & Structure
javascript syntaxjavascript
fn.lengthReturn Value
Number
Expected formal parameter count.
Working Example
Example Snippetjavascript
function f(a,b=0,...rest){} console.log(f.length);