Theodore Olsauskas-Warren
unread,Nov 22, 2022, 7:23:22 PM11/22/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium-dev, Eduard Hez, Demetrios Papadopoulos, Reilly Grant
HI Chromium-dev,
I was recently pointed to
this document on ECMAScript Features in Chromium when considering code making use of the
Nullish Coalescing operator (??). This document doesn't call out the operator at all (not allowed, not banned), neither does the
Google JS style guide. This absence was interpreted as the feature being disallowed.
I'm hoping to use this thread to form consensus on this one way or the other, then use it to update that the document (as per the instructions in it). I couldn't find any previous discussion on the topic.
I'd like to open the bidding with a case for explicitly allowing usage of the operator. Aside from enabling a more compact syntax, it can also help avoid accidental usage of "truthy" values via the ternary operator (e.g. return a ? a : b) as, by comparison, the nullish coalescing operator strictly compares against null or undefined.
+cc some folks recently involved in usage of the operator in WebUI.
Theo.