Multiple choice javascript

Under which of the following conditions will you need to include semi colons on a line of code?

  1. When you have multiple statements on multiple lines

  2. When you have multiple statements on a line

  3. When you have single statement on multiple lines

  4. When you have single statement on a line

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In many programming languages like C, Java, and JavaScript, semicolons act as statement terminators. While they often end lines, their primary structural necessity occurs when placing multiple distinct statements on a single line to help the compiler or interpreter distinguish between them.