[Chapter 5] 5.13 The Empty Statement
Author: David Flanagan
Date: Fri Aug 29 10:52:43 1997

#

| Chapter 5 Statements |

## 5.13 The Empty Statement

One final legal statement in JavaScript is the empty statement. It looks like this:

    ;

Executing the empty statement obviously has no effect and performs no action. You might think that there would be little reason to ever use such a statement, but it turns out that the empty statement is occasionally useful when you want to create a loop that has an empty body. For example:

    // initialize an array a
    for(i=0; i < a.length; a[i++] = 0) ;

To make your code clear, it can be useful to comment your empty statements as such:

    for(i=0; i < a.length; a[i++] = 0) /* empty */ ;

return |  | Summary of JavaScript Statements