Nullish coalescing operator (?) broken in Chrome, Big Sur

I just upgraded my Mac desktop to Big Sur.
I then found that js scripts were broken in Google Chrome but ok in Safari.
The culprit is the nullish coalescing operator ??.
Chrome issues a
test js 2.html:19 Uncaught SyntaxError: Unexpected token ‘?’
Tested with a html file with only a script tag containing only two lines of code.
var val2 = null;
alert((val2) ?? 39);
Safari brings up the alert dialog containing 39 and Chrome displays uncaught SyntaxError: Unexpected token ‘?’ jn the console.

What version of Chrome are you using on the mac?

Version 79.0.3945.130 (Official Build) (64-bit)

Thanks. It’s at version 80 when Chrome supported nullish coalescing.

I recommend that you update your web browser.

1 Like

Preferences were set to auto update but it was stuck trying to update. Had to delete it and re install latest version.
Perils of having too many computers. It worked on the other desktop, but I packed it away when I upgraded the current computer to Bug Sur.
Thanks for the advice.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.