JavaScript: The Definitive Guide

Previous Chapter 5
Statements
Next

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++] =index.html 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++] =index.html 0) /* empty */ ; 


return Summary of JavaScript Statements


file: /Techref/language/JAVA/SCRIPT/definitive/ch05_13.htm, 3KB, , updated: 2019年10月14日 16:00, local time: 2025年9月20日 01:23,
40.74.122.252:LOG IN

©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/Techref/language/JAVA/SCRIPT/definitive/ch05_13.htm"> [Chapter 5] 5.13 The Empty Statement</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here:
if you want a response, please enter your email address:
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

Welcome to massmind.org!

Welcome to techref.massmind.org!

.

AltStyle によって変換されたページ (->オリジナル) /