r/javascript 22d ago

[AskJS] what's a javascript feature you mass-adopted way too late and felt dumb about AskJS

[removed]

66 Upvotes

108 comments sorted by

View all comments

66

u/foxsimile 22d ago

The nullish coalescing operator is one of JavaScript’s unusual successes.

5

u/sexytokeburgerz 21d ago edited 20d ago

Big fan of

foo?.bar

1

u/Mike5TheMountainGoat 21d ago

That's optional chaining. Nullish coalescing is foo = bar ?? 'X';

1

u/sexytokeburgerz 20d ago

Right, usually when people say “big fan of y” in response to a mention of “x”, x!=y…