Statements are separated with semi colon (;) in JScript .NET. However, if you have line breaks between the statements, the semi colon is not required. However, it is recommended to always use it anyway, in case a line break is removed. You may have observed that all examples in this documentation use semi colons between the statements.
However, when working with the if, switch, while, do while, for and function statements you have to be careful with the semi colon. For example, remember that the while statement includes the statements within the curly brackets. If you place a semicolon just after the condition, like this:
while (condition); { <statements> }you will actually end up with a loop that never terminates. The semicolon will be interpreted as the end of an empty statement. It will be this empty statement that will be executed until the condition is false, not the statements within the curly brackets. The code that executes will be similar to this:
while (condition) { }<statements>The condition is likely never to return false, since no statements are executed. This means that the loop will never terminate. This will cause a time-out for the respondent. But notice that there are no syntactical errors in the script, so you will not receive any error message on the script as such.