Can someone explain the following sentence(appeared in ECMAScript 5.1 Grammar Notation) in plain text?

ArgumentList :
AssignmentExpression
ArgumentList , AssignmentExpression

"states that an ArgumentList may represent either a single AssignmentExpression or an ArgumentList, followed by a comma, followed by an AssignmentExpression. This definition of ArgumentList is recursive, that is, it is defined in terms of itself. The result is that an ArgumentList may contain any positive number of arguments, separated by commas, where each argument expression is an AssignmentExpression. Such recursive definitions of nonterminals are common."

有帮助吗?

解决方案

It means you can assign within the while (for example) clause and combine a number of assignments.

var a, b, c;
while (a, b = doSomething(), c = next())
{
 // Do stuff.
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top