Statements & Semicolons
What is a Statement?
A statement is a single instruction for the browser to do something. Each line below is a statement:
Copy to Clipboard
Semicolons: Do I Need Them?
Semicolons (;
) tell JavaScript where one statement ends and the next begins. They’re usually optional, but it’s a good habit to use them!
Copy to Clipboard
Tip: Always use semicolons to avoid weird bugs!