Joy Online Manual
NAME |
throw - Raise a JavaScript error |
SYNOPSIS |
throw expr
DESCRIPTION |
The expression expr will be evaluated and then the currently executing script will be interrupted as if an error had occurred. If a try...catch statement is currently in effect, the exact result of expr will be assigned to the catch variable and execution will continue in the error handler. If not, the result of expr will be converted to a string and then reported like any other JavaScript error. |
EXAMPLE |
js> try {
print("hi")
throw 25
print("there")
}
catch (x) {
print(x + 1)
}
hi
26
SEE ALSO |
Index |