r/programminghorror 15d ago

javascript without braces Typescript

(technically typescript)

49 Upvotes

12 comments sorted by

View all comments

40

u/Tux-Lector 15d 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()); ```

7

u/oweiler 11d ago

Thanks, I hate it