Readonly
$A readonly val with value of the internal readonly array.
To update the entire array in place, use list.replace()
.
Readonly
arrayGet the internal array. Use it as a read-only array. Should not modify the array in place directly. Use methods on the list instead.
Readonly
lengthGets the length of the array. This is a number one higher than the highest index in the array.
Sets new items to the list at specific index in place of the existing items.
An iterable object that contains key-value pairs.
this
Removes elements from the list starting from the specified index.
The zero-based location in the list from which to start deleting elements. A negative index will be ignored.
Optional
count: numberThe number of elements to remove. Default 1.
Inserts new elements to the list. Pushes existing elements to the right.
The zero-based location in the list from which to start inserting elements. A negative index will be ignored.
Rest
...items: TValue[]Elements to insert into the list.
Rest
...items: TValue[]New elements to add to the list.
Array#push Appends new elements to the end of the list, and returns the new length of the list.
Inserts new elements at the start of the list, and returns the new length of the list.
Rest
...items: TValue[]Elements to insert at the start of the list.
Array#unshift
Sets new item to the list at specific index in place of the existing item.
The zero-based location in the list at which to insert item. A negative index will be ignored.
Item to set to the list.
this
Optional
compareFn: ((a, b) => number)Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.
[11,2,22,1].sort((a, b) => a - b)
Array#sort Sorts the list in place.
Same as Array.prototype.splice
.
Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
The zero-based location in the array from which to start removing elements. A negative index will be ignored.
Optional
deleteCount: numberThe number of elements to remove.
An array containing the elements that were deleted.
Same as Array.prototype.splice
.
Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
The zero-based location in the array from which to start removing elements. A negative index will be ignored.
The number of elements to remove.
Rest
...items: TValue[]Elements to insert into the array in place of the deleted elements.
An array containing the elements that were deleted.
A reactive list. Similar to an Array except bracket-notation(e.g.
arr[0]
) is not allowed to get/set elements. Changes to the list will be notified to subscribers oflist.$
.