tc39 / proposal-optional-chaining

https://tc39.github.io/proposal-optional-chaining/
4.94k stars 75 forks source link

Optional Delete example is incorrect #23

Closed jridgewell closed 7 years ago

jridgewell commented 7 years ago

From the readme:

delete a?.b
delete (a == null ? undefined : a.b) // does work as expected

This does not work as expected. Instead, delete has to be moved into the alternate:

a == null ? undefined : delete a.b // does work as expected
claudepache commented 7 years ago

You’re right; it will be corrected in the next revision.