Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Loops-Foreach/Lang/loops-foreach.lang
Normal file
13
Task/Loops-Foreach/Lang/loops-foreach.lang
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
$collection = fn.arrayOf(1, 2, 3)
|
||||
|
||||
# Foreach loop [Works with iterable types (text, collections [array, list])]
|
||||
$ele
|
||||
foreach($[ele], $collection) {
|
||||
fn.println($ele)
|
||||
}
|
||||
|
||||
# Foreach function
|
||||
# Array: fn.arrayForEach(&arr, func)
|
||||
# List: fn.listForEach(&list, func)
|
||||
|
||||
fn.arrayForEach($collection, fn.println)
|
||||
Loading…
Add table
Add a link
Reference in a new issue