DEV Community

Discussion on: Why you should use semicolons in spite of ASI

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

I think that, on the safe side, always add semicolon; but the only real time I need semicolon, is when the line starts with a bracket

  • IIFE for scope declaration
  • Type casting in TypeScript, which requires brackets to be able to add .

In the end, it is more about being consistent, but it is easier to be consistent on the safe side.