List$Typings<T> extension
- on
-
- List<
T>
- List<
Properties
- count ↔ num
-
Available on List<
This read-only property is the length of the List.T> , provided by the List$Typings extensiongetter/setter pair -
iterator
↔ Iterator<
T> -
Available on List<
Gets an object that you can use for iterating over the List. The key will be an integer from zero to the count-1. The value will be the item at that index in the list. Typical usage:T> , provided by the List$Typings extensiongetter/setter pair -
iteratorBackwards
↔ Iterator<
T> -
Available on List<
Gets an object that you can use for iterating over the List in backwards order. The key will be an integer from count-1 to zero. The value will be the item at that index in the list. The list is not modified by traversing in reverse order. Typical usage:T> , provided by the List$Typings extensiongetter/setter pair - length ↔ num
-
Available on List<
This read-only property is the length of the List, a synonym for the #count property.T> , provided by the List$Typings extensiongetter/setter pair - size ↔ num
-
Available on List<
This read-only property is the length of the List.T> , provided by the List$Typings extensiongetter/setter pair
Methods
-
add(
T val) → List< T> -
Available on List<
Adds a given value to the end of the List.T> , provided by the List$Typings extension -
addAll(
Object coll) → List< T> -
Available on List<
Adds all of the values of a collection to the end of this List.T> , provided by the List$Typings extension -
all(
bool pred(T)) → bool -
Available on List<
This is true if all invocations of the given predicate on items in the collection are true.T> , provided by the List$Typings extension -
any(
bool pred(T)) → bool -
Available on List<
This is true if any invocation of the given predicate on items in the collection is true.T> , provided by the List$Typings extension -
clear(
) → void -
Available on List<
Clears the List. This sets the #count to zero.T> , provided by the List$Typings extension -
contains(
T val) → bool -
Available on List<
Returns whether the given value is in this List. @param {T} val The value to check. @return {boolean} Whether or not the value is contained within the List.T> , provided by the List$Typings extension -
copy(
) → List< T> -
Available on List<
Makes a shallow copy of this List. The values are not copied, so if they are objects they may continue to be shared with the original List. @expose @return {List.T> , provided by the List$Typings extension -
delete(
T val) → bool -
Available on List<
Removes a given value (if found) from the List.T> , provided by the List$Typings extension -
each(
void func(T)) → List< T> -
Available on List<
Call the given function on each item in the collection. @expose @param {function(T)} func This function must not modify the collection. @return {List.T> , provided by the List$Typings extension -
elt(
num i) → T -
Available on List<
Returns the element at the given index. @param {number} i int The index of the element to return. @return {T} the value at the given index.T> , provided by the List$Typings extension -
filter(
bool pred(T)) → List< T> -
Available on List<
Call the given predicate on each item in the collection and for each item that it returns true, collect the item in a new List.T> , provided by the List$Typings extension -
first(
) → T? -
Available on List<
Returns the first item in the list, or null if there is none. @return {T|null} This returns null if there are no items in the list.T> , provided by the List$Typings extension -
get(
num i) → T -
Available on List<
Returns the element at the given index. @param {number} i int The index of the element to return. @return {T} the value at the given index.T> , provided by the List$Typings extension -
has(
T val) → bool -
Available on List<
Returns whether the given value is in this List. @param {T} val The value to check. @return {boolean} Whether or not the value is contained within the List.T> , provided by the List$Typings extension -
indexOf(
T val) → num -
Available on List<
Returns the index of the given value if it is in this List. @param {T} val The value to check. @return {number} int returns -1 if the value is not in this list.T> , provided by the List$Typings extension -
insertAt(
num i, T val) → void -
Available on List<
Insert a value before the index i.T> , provided by the List$Typings extension -
last(
) → T? -
Available on List<
Returns the last item in the list, or null if these is none. @return {T|null} This returns null if there are no items in the list. @since 1.5T> , provided by the List$Typings extension -
map<
S> (S func(T)) → List< S> -
Available on List<
Call the given function on each item in the collection and collect the results in a new List.T> , provided by the List$Typings extension -
pop(
) → T? -
Available on List<
Returns the last item in the list and removes it from the list, or just return null if these is none. Use #add to push an item onto the end of the list. Use #last to get the last item without reducing the length of the list. @return {T|null} This returns null if there are no items in the list. @since 1.5T> , provided by the List$Typings extension -
push(
T val) → void -
Available on List<
Adds a given value to the end of the List.T> , provided by the List$Typings extension -
remove(
T val) → bool -
Available on List<
Removes a given value (if found) from the List.T> , provided by the List$Typings extension -
removeAt(
num i) → void -
Available on List<
Removes a value at a given index from the List.T> , provided by the List$Typings extension -
removeRange(
num from, num to) → List< T> -
Available on List<
Removes a range of values from the List, given both the starting and the ending zero-based indexes. For example,T> , provided by the List$Typings extension -
reverse(
) → List< T> -
Available on List<
Reverse the order of items in this List. @return {List.T> , provided by the List$Typings extension -
set(
num i, T val) → void -
Available on List<
Set the element at the given index to a given value. @param {number} i int The index of the element to set. @param {T} val The value to set at the index.T> , provided by the List$Typings extension -
setElt(
num i, T val) → void -
Available on List<
Set the element at the given index to a given value. @param {number} i int The index of the element to set. @param {T} val The value to set at the index.T> , provided by the List$Typings extension -
sort(
num sortfunc(T, T)) → List< T> -
Available on List<
Sort the List according to a comparison function. @param {function(T,T):number} sortfunc This function is passed two items in the list. It should return zero if they are equal, less than zero if the first value should come before the second value, or greater than zero if the first value should come after the second value. @return {List.T> , provided by the List$Typings extension -
sortRange(
num sortfunc(T, T), [num? from, num? to]) → List< T> -
Available on List<
(undocumented) Sorts a range of consecutive elements in this List based on the given comparison function. @param {function(,):number} sortfunc This function is passed two elements in the list. It should return zero if they are equal, less than zero if the first value should come before the second value, or greater than zero if the first value should come after the second value. @param {number=} from int The optional index at which to start the sort, including that element; default to zero, the first element of the list. @param {number=} to int The optional index at which to end the sort, excluding that element; defaults to the end of the list. @return {List.T> , provided by the List$Typings extension -
toArray(
) → Array< T> -
Available on List<
Produces a JavaScript Array from the contents of this List. @return {Array.T> , provided by the List$Typings extension -
toSet(
) → Set< T> -
Available on List<
Converts the List to a Set. The count of the resulting Set may be less than the count of this List if any duplicates were removed. @return {Set.T> , provided by the List$Typings extension -
toString$(
) → String -
Available on List<
@return {string}T> , provided by the List$Typings extension