Read our article on Lists for an explanation of these blocks.
Creates and returns an empty list. Usually, you'll want to set this immediately to a list attribute.
new Array<Dynamic>()
Returns a shallow copy of the specified list.
list.copy()
Adds the given value to the end of the list.
list.push([VALUE]);
Inserts the given value at the specified index of the list. This will push everything at that index and after down one position. The index must be between 0 and (size of list - 1) inclusive.
list.insert([INT], [VALUE]);
Removes the given value from the list, if it exists. If it does not exist, nothing happens.
list.remove([VALUE]);
Removes the value at the specified index from the list. The index must be between 0 and (size of list - 1) inclusive.
list.splice([INT], 1);
Replaces the item at the specified index with another for the list. The index must be between 0 and (size of list - 1) inclusive.
list[[INT]] = [VALUE];
Removes all values from the list.
Utils.clear(list);
Returns the item at the specified index in the list. The index must be between 0 and (size of list - 1) inclusive.
list[[INT]]
Returns the index of the item in the list. If the item is in the list multiple times, this returns the first index found. If the item isn't in the list, this returns -1.
list.indexOf([VALUE])
Returns true
if the list contains the specified item.
Utils.contains(list, [VALUE])
Returns the number of items in the list.
list.length
Returns true
if the list contains no items.
(list.length == 0)
Lets you perform logic on each item in the list. Use the embedded item
block to retrieve the current item being examined.
for(item in cast(list, Array<Dynamic>)) {
[ACTIONS]
}