List.add() method.

This commit is contained in:
Bob Nystrom
2013-11-26 18:02:10 -08:00
parent eaeec01dc6
commit 897a396599
6 changed files with 125 additions and 69 deletions
+10
View File
@@ -0,0 +1,10 @@
var a = []
a.add(1)
io.write(a) // expect: [1]
a.add(2)
io.write(a) // expect: [1, 2]
a.add(3)
io.write(a) // expect: [1, 2, 3]
// Returns added element.
io.write(a.add(4)) // expect: 4