JavaScript syntax: Difference between revisions

Content deleted Content added
If … else: Unnecessary reexplanation provided, thus removed
Line 979:
<syntaxhighlight lang=JavaScript>
if (expr) {
//statements;
} else if (expr2) {
//statements;
} else {
//statements;
}
</syntaxhighlight>
 
This is also possible:
 
<syntaxhighlight lang=JavaScript>
if (exprA == exprB) {
//statements;
} else if (expr2) {