-
Notifications
You must be signed in to change notification settings - Fork 75
Optional spread syntax #55
Comments
Indeed, but it is out of the scope of this proposal. I could add a note in the explainer for “possible future improvements”. (It is neither a pressing issue, since |
Also, with the nullish coalescing operator, I think |
I agree it's not as pressing as the others, but the same just works bit could be said about them:
I would think in this case we could elide the empty array allocation completely. |
You could use an empty string as well, but i see what you mean. |
I like @claudepache 's suggestion in #55 (comment) . This proposal specifically tries to be relatively minimal in the constructs supported, compared to the CoffeeScript equivalent, to keep things easy to understand. |
Besides spread, there are other constructs that expect iterable and may be made optional:
|
Regret:
so that optional spread would have worked everywhere. |
Heh— |
Spread for arrays and function calls is not null-safe (though it is for object spread).
It'd be very convenient to write them as:
Instead of:
The text was updated successfully, but these errors were encountered: