Does JavaScript code run fine even if we don't use semicolon at the end of a statement?(I'm a beginner) | SoloLearn: Learn to code for FREE!

+1

Does JavaScript code run fine even if we don't use semicolon at the end of a statement?(I'm a beginner)

3/28/2020 2:00:32 PM

Sagar Thapaliya

4 Answers

New Answer

0

It means it is better to use semicolon??

+3

You can omit semicolon in *certain cases* because javascript does automatic semicolon insertion. Read : https://codeburst.io/ecmascript-automatic-semicolon-insertion-50f09091e377

+1

Thanks 🇮🇳Omkar🕉 👍👍😁

0

Sagar Thapaliya , Yes. You should use semicolon even if you know it'll be automatically inserted. It's considered as good practice to use semicolon in JS.