mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
14 lines
137 B
Plaintext
14 lines
137 B
Plaintext
import compound;
|
|
|
|
fn p(x) {
|
|
print x;
|
|
};
|
|
|
|
fn f(acc, k, v) {
|
|
acc(v);
|
|
return acc;
|
|
}
|
|
|
|
var a = [1, 2, 3, 4];
|
|
|
|
a.reduce(p, f); //prints "10" |