Plange


evaluate the last expression repeatedly while iterating over the elements of the specified Collection

syntax

"for" {IC} "(" {IC} (([ (TYPE_DEREFERENCE | IMPLICIT_TYPE_DEREFERENCE) {IC} ] IDENTIFIER ) | EXPRESSION ) {IC} ("in"|"∈") {IC} EXPRESSION {IC} ")" {IC} EXPRESSION

Example

<> fibArray = [ 0, 1, 1, 2, 3, 5, 8, 13 ];
for (element ∈ fibArray) {
    print(element);
}

Example

for ((key, value) ∈ myMap) {
    //do something
}

copyright © Brent Lewis 2017