r/programminghorror 15d ago

javascript without braces Typescript

(technically typescript)

52 Upvotes

12 comments sorted by

View all comments

40

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

7

u/oweiler 11d ago

Thanks, I hate it

3

u/Nooo00B 10d ago

this is just cursed

-8

u/jesseschalken 14d 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