That's a difference between Java and JavaScript.
Actually, there are certain places in JavaScript where semicolons are required (between statements), some places where they are optional (before a close brace), and some places where they are prohibited (before an else).