diff --git a/doc/site/modules/core/list.markdown b/doc/site/modules/core/list.markdown index 2c389b65..89a04b12 100644 --- a/doc/site/modules/core/list.markdown +++ b/doc/site/modules/core/list.markdown @@ -22,7 +22,19 @@ Creates a new empty list. Equivalent to `[]`. ### **add**(item) -Appends `item` to the end of the list. +Appends `item` to the end of the list. Returns the added item. + +### **addAll**(other) + +Appends each element of `other` in the same order to the end of the list. `other` must be [an iterable](../../control-flow.html#the-iterator-protocol). + +
+var list = [0, 1, 2, 3, 4] +list.addAll([5, 6]) +System.print(list) //> [0, 1, 2, 3, 4, 5, 6] ++ +Returns the added items. ### **clear**() @@ -173,3 +185,13 @@ var other = ["d", "e", "f"] var combined = letters + other System.print(combined) //> [a, b, c, d, e, f] + +### **\***(count) operator + +Creates a new list by repeating this one ```count``` times. It is a runtime error if ```count``` is not a non-negative integer. + +
+var digits = [1, 2] +var tripleDigits = digits * 3 +System.print(tripleDigits) //> [1, 2, 1, 2, 1, 2] +