this post was submitted on 02 Mar 2025
72 points (92.9% liked)

Programmer Humor

20898 readers
942 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

founded 2 years ago
MODERATORS
 

Someone had to do this before the riots started.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 14 hours ago

This, unfortunately, means that semicolons are often inserted in places where you were not expecting them

example:

()=>{
  return {k:"v"}; // returns the object
}
()=>{
  return      // returns undefined 
    {k:"v"};  // unreachable 
}

so the advice is to always include them manually yourself so that you are never unpleasantly surprised.

The example will be unpleasantly surprising, no matter where you put semicolons.