- Loading...
...
Nashorn implements number of syntactic and API extensions as well. This page describes syntax and API extensions of nashorn implementation.
This Mozilla JavaScript 1.4 extension is also supported by Nashorn. A single try.. statement can have more than one catch clause each with it's own catch-condition.
| Code Block | ||
|---|---|---|
| ||
try {
func()
} catch (e if e instanceof TypeError) {
// handle TypeError here
} catch (e) {
// handle any other..
} |
...
This is another a Mozilla JavaScript 1.6 extension supported by Nashorn. ECMAScript for..in iterates over property names or array indices of an object. for..each..in loop iterates over property values of an object rather than property names/indices. See also https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for_each...in
...