Hacker News new | ask | show | jobs
by ww520 3400 days ago
? already has different forms as of now. You can do foo()?; or foo()?.bar(). People don't seem to be confused.

expr ? expr : expr is just another form. The ternary form is so well known that I doubt people have problem recognizing it.

2 comments

The usage of ? in foo()?.bar() is no different from its usage in foo()?; ...
Are those really 2 different forms? I was under the impression that these were the same:

    foo()?.bar()
    (foo()?).bar()