1. Return 0.
FormalParameters
:
FormalParameterList
,
FunctionRestParameter
1. Return
ExpectedArgumentCount
of
FormalParameterList
.
NOTE
FormalParameterList
:
FormalParameter
1. If
HasInitializer
of
FormalParameter
is
true
, return 0.
2. Return 1.
FormalParameterList
:
FormalParameterList
,
FormalParameter
1. Let
count
be
ExpectedArgumentCount
of
FormalParameterList
.
2. If
HasInitializer
of
FormalParameterList
is
true
or
HasInitializer
of
FormalParameter
is
true
, return
count
.
3. Return
count
+ 1.
ArrowParameters
:
BindingIdentifier
1. Return 1.
ArrowParameters
:
CoverParenthesizedExpressionAndArrowParameterList
1. Let
formals
be
CoveredFormalsList
of
CoverParenthesizedExpressionAndArrowParameterList
.
2. Return
ExpectedArgumentCount
of
formals
.
PropertySetParameterList
:
FormalParameter
1. If
HasInitializer
of
FormalParameter
is
true
, return 0.
2. Return 1.
AsyncArrowBindingIdentifier
:
BindingIdentifier
1. Return 1.
FunctionDeclaration
[Yield, Await, Default]
:
function
BindingIdentifier
[?Yield, ?Await]
(
FormalParameters
[~Yield, ~Await]
)
{
FunctionBody
[~Yield, ~Await]
}
[+Default]
function
(
FormalParameters
[~Yield, ~Await]
)
{
FunctionBody
[~Yield, ~Await]
}
FunctionExpression
:
The ExpectedArgumentCount of a
FormalParameterList
is the number of
FormalParameters
to the
left of either the rest parameter or the first
FormalParameter
with an Initializer. A
FormalParameter
without an initializer is allowed after the first parameter with an initializer but such parameters
are considered to be optional with
undefined
as their default value.
15.2 Function Definitions
Syntax
394