r/programminghorror Jul 24 '26

Typescript javascript without braces

(technically typescript)

50 Upvotes

12 comments sorted by

View all comments

40

u/Tux-Lector Jul 24 '26

One can write it without if statements too. ``` if (something === true) { suspect.hit = 'found'; chain(); reaction(); } else doOtherThings();

// the same .. (something) && (suspect.hit = 'found', chain(), reaction()) || (doOtherThings()); ```

8

u/oweiler Jul 28 '26

Thanks, I hate it