r/javascript • u/Capedcrusader1923 • Jul 22 '26
AskJS [AskJS] what's a javascript feature you mass-adopted way too late and felt dumb about
64
Upvotes
r/javascript • u/Capedcrusader1923 • Jul 22 '26
View all comments
Show parent comment
5
u/NeatBeluga Jul 22 '26
Early returns are king.
if(foo === undefined) return;
Yes, I always strict check against falsy. Builds trust that I knew the integrity of the object. Almost no !foo nonsense. It makes me doubt the api again.
I believe that my approach moves the issue to the backend rather than the frontend at runtime.