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.