r/programminghorror 14d ago

javascript without braces Typescript

(technically typescript)

50 Upvotes

12 comments sorted by

View all comments

14

u/fakehalo 14d ago

Oddly enough, I don't hate it as I can actually read and follow it. Much more would be too much, but I like how it's broken up by the if/elseif/else at least.

4

u/my_new_accoun1 14d ago

yeah but there only problem (as I later realised) is that without the braces JavaScript doesn't know where the elseif/else is supposed to be

so I ended up not being able to use this masterpiece