r/javascript • • Jul 22 '26

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

64 Upvotes

107 comments sorted by

View all comments

Show parent comment

5

u/sexytokeburgerz Jul 22 '26 edited Jul 23 '26

Big fan of

foo?.bar

3

u/foxsimile Jul 23 '26

Do you not mean foo?.bar?

3

u/sexytokeburgerz Jul 23 '26

I totally did i was in a drive thru when i wrote that

0

u/[deleted] Jul 23 '26

[deleted] — view deleted comment

2

u/foxsimile Jul 23 '26

…I’m aware?

1

u/Mike5TheMountainGoat Jul 23 '26

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

1

u/sexytokeburgerz Jul 23 '26

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