Javascript only requires a semicolon to separate statements on a single line. However, I would recommend that you follow good practices and use them.
From the manual for typescript
Use semicolons:
Reasons: Explicit semicolons help language formatting tools give consistent results. The lack of ASI (automatic semicolon) may disable new developers, for example.
foo() (function(){})
there will be one operator (not two).
I understand that ultimately it is a matter of style, since you should not have any problems if you do not use them when they are not strictly required, although in order to be consistent, it is better to use them than not.
This is also a good article. https://www.codecademy.com/blog/78
Hope this helps!
source share