Implemented array.forEach(fn)

This commit is contained in:
2026-04-26 11:59:15 +10:00
parent efc9fe1406
commit af30246e0c
5 changed files with 105 additions and 31 deletions
+8 -15
View File
@@ -1,18 +1,11 @@
fn output(arg) {
print arg;
}
var array = ["alpha", "bravo", "charlie"];
var table: Table = ["answer":42];
print table.hasKey("answer");
print table.hasKey("question");
table.insert("question", "roads");
print table.hasKey("answer");
print table.hasKey("question");
table.remove("answer");
print table.hasKey("answer");
print table.hasKey("question");
array.forEach(echo);
array.forEach(output);