DEV Community

Discussion on: Why doesn't JavaScript have a nullish-coalescing-assignment (??=) operator?

Collapse
 
midudev profile image
Miguel Ángel Durán 👨‍💻

Because it has already the operator:
developer.mozilla.org/en-US/docs/W...

Collapse
 
baenencalin profile image
Calin Baenen

Oh, whenever I try(ed) to use it, it gives me an error in NodeJS.
And in browser JavaScript, something doesn't seem quite right with its behavior (unless it's just SoloLearn acting up):
It should log  raw `10` endraw  and  raw `25` endraw , but it logs  raw `10` endraw  twice, instead.
(10 and 25 should be logged, but 10 gets logged twice, instead.)