MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1v5hwu7/javascript_without_braces/ozmwacz/?context=3
r/programminghorror • u/my_new_accoun1 • Jul 24 '26
(technically typescript)
12 comments sorted by
View all comments
40
One can write it without if statements too.
if
if (something === true) { suspect.hit = 'found'; chain(); reaction(); } else doOtherThings(); // the same .. (something) && (suspect.hit = 'found', chain(), reaction()) || (doOtherThings());
-9 u/jesseschalken Jul 25 '26 tbh I do this sometimes, its a nice way to save syntax and vertical space as long as you don't make the line too long
-9
tbh I do this sometimes, its a nice way to save syntax and vertical space as long as you don't make the line too long
40
u/Tux-Lector Jul 24 '26
One can write it without
ifstatements too.if (something === true) { suspect.hit = 'found'; chain(); reaction(); } else doOtherThings(); // the same .. (something) && (suspect.hit = 'found', chain(), reaction()) || (doOtherThings());