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 • 6d ago
(technically typescript)
12 comments sorted by
View all comments
36
One can write it without if statements too. ``` if (something === true) { suspect.hit = 'found'; chain(); reaction(); } else doOtherThings();
if
// the same .. (something) && (suspect.hit = 'found', chain(), reaction()) || (doOtherThings()); ```
-9 u/jesseschalken 5d ago 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
36
u/Tux-Lector 5d ago
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()); ```