ECMAScript® 2024 Language Specification

Draft ECMA-262 / February 15, 2024

13.16 Comma Operator ( , )

Syntax

Expression[In, Yield, Await] : AssignmentExpression[?In, ?Yield, ?Await] Expression[?In, ?Yield, ?Await] , AssignmentExpression[?In, ?Yield, ?Await]

13.16.1 Runtime Semantics: Evaluation

Expression : Expression , AssignmentExpression
  1. Let lref be ? Evaluation of Expression.
  2. Perform ? GetValue(lref).
  3. Let rref be ? Evaluation of AssignmentExpression.
  4. Return ? GetValue(rref).
Note

GetValue must be called even though its value is not used because it may have observable side-effects.