mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-05-06 00:40:11 +10:00
Added the following attributes:
* table.length * table.insert(key,value) * table.hasKey(key) * table.remove(key) There's basically only iteration and sorting left.
This commit is contained in:
+15
-3
@@ -1,6 +1,18 @@
|
||||
|
||||
var array = [1,2,3];
|
||||
|
||||
array.pushBack(4);
|
||||
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");
|
||||
|
||||
|
||||
print array.popBack();
|
||||
Reference in New Issue
Block a user