Some books and tutorials advocate and tell you to add semicolons to the end of every JavaScript line. Some people say youโre a lousy developer if you donโt do it.
Well, you will notice that I donโt add semicolons to the end of any line in JavaScript. Thereโs a reason for it.
Semicolons are optional
JavaScript inserts semicolons for you automatically. Thatโs why itโs optional to write semicolons. You donโt need semicolons to write good JavaScript.
In fact, itโs easier to read and write JavaScript when you leave out the semicolons. Many experts have already done so. Iโd leave the explaining of why you donโt need semicolons to this article. Have a read and youโll understand why.
Welcome! Unfortunately, you donโt have access to this lesson. To get access, please purchase the course or enroll in Magical Dev School.
Unlock this lesson