this post was submitted on 14 Aug 2025
282 points (96.4% liked)
Programmer Humor
25705 readers
1274 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Was looking at it and could not figure out why their weren't any semicolon's.
Neither Javascript nor Typescript require semicolon, it is entirely a stylistic choice except in very rare circumstances that do not come up in normal code.
Explanation for nerds
The reason is the JS compiler removes whitespace and introduces semicolons only "where necessary".So writing
Is not the same as
Because the compiler will see that and make it:
You big ol' nerd. Tee-hee.
That's terrifying, especially in JS where no type system will fuck you up for returning nothing when you should've returned a boolean.