Defaults. function f(a = expr) evaluates expr each time f is called with a missing or undefined. Not at definition time, and not for null, 0, or ''. So list = [] gives every call a fresh array, and a default can call a function with side effects.
Order and scope. Parameters are initialized left to right. A default can read earlier parameters; reading a later one is a TDZ ReferenceError. When any parameter has an expression, FunctionDeclarationInstantiation gives the parameters their own Environment Record and puts body vars in a separate one, so closures in the parameter list can't see declarations in the body.
Rest. ...rest must be last, has no default, and gets the remaining arguments as a real Array. It replaces most uses of arguments.
Side effects on the function.
lengthcounts only the parameters before the first default or rest parameter.- A parameter list with defaults, rest, or destructuring is "non-simple": a
"use strict"directive in the body becomes aSyntaxError, andargumentsis the unmapped kind.