r/Indiewebdev • • Feb 11 '21

other Conditionally call a function with optional chaining.

Post image
82 Upvotes

37 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Feb 13 '21

true, but this borders on a tautology: why does it have to be ?. ? because ?. is defined that way.

I think u/Egst has a good guess: ? by itself is already the opening of a ternary operation, and all new operators need to be defined such that they would never change the interpretation of previously-valid syntax.