Using JavaScript Statements

This section provides a quick reference to some of the more important JavaScript statements. Those listed here are in alphabetical order—many have examples. The formatting of these entries means the following:

  • All JavaScript keywords are in monospaced font.

  • Words in monospace italic represent user-defined names or statements.

  • Any portions enclosed in square brackets ([ and ]) are optional.

  • { statements} indicates a block of statements, which can consist of a single statement or multiple statements enclosed by braces.

The break Statement

The break statement terminates the current while or for loop and transfers program control to the statement that follows the terminated loop.

Syntax:

break

Example:

The following function ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.