Array
Index
Accessor
at
Return an item at the
index
positionType parameters
- Item
size
Return the length of the array
Constructor
empty
Always returns an empty array
Type parameters
- Item = never
generate
Generate an array of
length
usingmapFn(index)
on each elementType parameters
- Value
of
Returns a new array from a set of items.
Type parameters
- Item
Predicate
every
Determines whether all the members of an array satisfy the specified test.
Type parameters
- Item
- RefinedItem
includes
Determines whether an array includes a certain item, returning true or false as appropriate.
Type parameters
- Item
isEmpty
Return true if the size of the array is 0
some
Determines whether the specified callback function returns true for any item of an array.
Type parameters
- Item
Type
hasInstance
Alias to
Array.isArray()
Other
concat
Concatenate all elements of arrays Equivalent to
[...array, ...extension[0], ...extension[1], ...]
,Type parameters
- Item
deleteAt
Return an array excluding the item at the
index
Type parameters
- Item
filter
Returns the items of an array that meet the condition specified in a callback function.
Type parameters
- Item
- RefinedItem
find
Returns the value of the first element in the array where predicate is true, and Option.None otherwise.
Type parameters
- Item
- RefinedItem
findIndex
Returns the index of the first element in the array where predicate is true, and Option.None otherwise.
Type parameters
- Item
findLast
Returns the value of the last element in the array where predicate is true, and Option.None otherwise.
Type parameters
- Item
- RefinedItem
findLastIndex
Returns the index of the last element in the array where predicate is true, and Option.None otherwise.
Type parameters
- Item
flatMap
Calls a defined callback function on each item of an array. Each calls should return an array. The final result is the concatenation of each arrays.
Type parameters
- FromItem
- ToItem
indexOf
Returns the index of the first occurrence of
searchItem
in an array.Type parameters
- Item
insertAt
Add
item
at theindex
in the arrayType parameters
- Item
lastIndexOf
Returns the index of the last occurrence of a specified
searchItem
in an array.Type parameters
- Item
map
Calls a defined callback function on each item of an array, and returns an array that contains the results.
Type parameters
- FromItem
- ToItem
reduce
Calls the specified callback function for all the items in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Type parameters
- Item
- ReturnValue
reduceRight
Calls the specified callback function for all the items in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Type parameters
- Item
- ReturnValue
reverse
Return a reversed array
Type parameters
- Item
setAt
Replace
item
at theindex
in the arrayType parameters
- Item
slice
Returns a section of an array.
Type parameters
- Item
sort
Return a sorted array using
compareFn
Type parameters
- Item
splice
Add
item
at theindex
in the arrayType parameters
- Item
A collection of functions to manipulate readonly arrays.