logoalt Hacker News

yxhuvudtoday at 7:14 AM1 replyview on HN

In aggregate this looks like a godsend, but there are some examples (like foo?.:method) that looks atrocious.


Replies

Ciantictoday at 9:40 AM

Yeah, "?." as safe navigation operator even in JS where it already exists is eye-sore. They could use some other single character instead of two characters. Question mark is already doing a lot with ternaries etc.

Instead of obj?.:method?.(…) it would be like obj#:method#(…)

Replace # with your favorite extra character instead of questionmark.

show 1 reply