In JavaScript, the semicolon is optional as a statement separator, but omitting semicolons can be confusing.
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());
function fun() {
return 5;
}
print(fun());