In JavaScript, the semicolon is optional as a statement separator, but omitting semicolons can be confusing.

Noncompliant Code Example

Here is an example of such confusing code:

function fun() {
  return
       5
}
print(fun());

Will print "undefined", because interpreted as:

function fun() {
  return;
  5;
}
print(fun());

Compliant Solution

function fun() {
  return 5;
}
print(fun());