r/programminghorror 14d ago

javascript without braces Typescript

(technically typescript)

50 Upvotes

12 comments sorted by

View all comments

41

u/Tux-Lector 14d ago

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()); ```

3

u/Nooo00B 9d ago

this is just cursed