• 0 Posts
  • 4 Comments
Joined 2 years ago
cake
Cake day: July 24th, 2023

help-circle

  • 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.