Java Reference
In-Depth Information
execution control statements
Code execution is controlled in a variety of ways. In addition to the conditional and loop
statements, the following statements also contribute to execution control.
stateMent
introduced
description
JavaScript 1.0
Used to stop execution of the block of statements in the
current iteration of a while or for loop; execution of the
loop continues with the next iteration.
continue
JavaScript 1.0
Used to specify the value to be returned by a function.
return
JavaScript 1.0
Specifies the default object for a block of code.
with
exception handling statements
Errors are a natural part of programming, and JavaScript provides you with the means to catch
errors and handle them gracefully.
stateMent
introduced
description
JavaScript 1.4
Throws a custom exception defined by the user.
Throw
try...
catch...
finally
JavaScript 1.4
Executes the statements in the try block; if any exceptions
occur, these are handled in the catch block. The finally
block allows you to stipulate statements that will be
executed after both the try and catch statements.
other statements
The following table lists other JavaScript statements and when they were introduced.
stateMent
introduced
description
// single line
comment
JavaScript 1.0
Single lines of notes that are ignored by the script
engine and that can be used to explain the code.
/* multi‐line
comment */
JavaScript 1.0
Multiple lines of notes that are ignored by the script
engine and that can be used to explain the code.
top‐level properties and functions
These are core properties and functions, which are not associated with any lower‐level object,
although in the terminology used by ECMAScript and by Jscript, they are described as properties
and methods of the global object.
Search WWH ::




Custom Search