Closed tolmasky closed 1 year ago
I'm just curious why () was chosen instead of [] for array binding patterns:
Foo[y] = x;
vs.
Foo(y) = x;
The syntax Foo[y] = x
is already valid and meaningful JavaScript and thus can't be used for this. ()
was chosen because a call expression isn't a valid assignment target and will always throw when assigned to today.
Ah yes, I think I was only looking at the Declarations and not the Assignments. Thanks!
I'm just curious why () was chosen instead of [] for array binding patterns:
vs.