- Loading...
...
| Code Block | ||
|---|---|---|
| ||
// for each (variable in object) { statement } // print each array element var arr = [ "hello", "world" ]; for each (a in arr) { print(a) } |
for..each works on Java arrays as well as Java collections (any Iterable actually).
| Code Block | ||
|---|---|---|
| ||
var System = Java.type("java.lang.System") for each (p in http://System.properties .entrySet()) { print(p.key, "=", p.value) } |
...