1 of 9

Logical Assignment Operators

For Stage 3

2 of 9

In a nutshell

Input

Output

a ||= b

a || (a = b)

a &&= b

a && (a = b)

a ??= b

a ?? (a = b)

3 of 9

Decided on Short Circuiting

  • Common cases are unobservable anyways
  • Don't need to worry about destructive Setters
  • Precedence from Ruby, CoffeeScript, and C#

4 of 9

Checklist

  • ✅ Spec Text
  • ✅ Reviewers
    • ✅ Kevin Gibbons (#15)
    • ✅ Daniel Rosenwasser (#20)
  • ✅ Editors (#17)
    • ✅ Kevin Gibbons
    • ✅ Shu-yu Guo
    • ✅ Jordan Harband
    • ✅ Michael Ficarra
  • ✅ Test262 (#2559, #2560)

5 of 9

Syntax is very simple

6 of 9

Semantics are very simple

7 of 9

Semantics are very simple

8 of 9

Semantics are very simple

9 of 9

Stage 3?