Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titlefor each loop
// 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
titlefor..each Java map
var System  = Java.type("java.lang.System")

for each (p in http://System.properties .entrySet()) {
    print(p.key, "=", p.value) 
}

New expression with last argument after ")"

...