Readonly_Readonly[iterator]Readonly[toFind the index of a value. Accepts unknown (Scala: indexOf(elem: Any)).
ReadonlylengthRemove a value. Accepts unknown so an unrelated-type arg is a safe no-op (Scala: -(elem: Any)).
Takes the first n elements from the collection.
Takes the last n elements from the collection.
Takes elements from the start while the predicate is true.
Gets the first element of the collection.
Gets the last element of the collection.
Counts elements that satisfy the predicate. For single-value containers: returns 0 or 1 For collections: returns the count of matching elements
Drops elements from the start while the predicate is true.
Tests whether any element satisfies the predicate. For single-value containers: tests the single value For collections: returns true if any element matches
Flattens a collection of collections into a single collection.
Left-associative fold over all elements using an initial value and combining function. Unlike foldLeft (which is curried), this provides a convenient uncurried signature.
The final accumulated value
Applies an effect function to each element. For single-value containers: applies to the value if present For collections: applies to each element
Converts this monad to an Either.
Conversion rules:
The value to use for the Left case when the source is empty/none/failure
An Either with the value as Right or the provided leftValue as Left
Converts this monad to a Try.
Conversion rules:
A Try containing Success with the value or Failure with an appropriate error
Immutable List. Covariant in A (
<out A>) — mirrors Scala'sList[+A].Methods that would otherwise force A-invariance use TS equivalents of Scala's co-variance patterns:
contains,indexOf,remove) takeunknown, matching Scala's-(elem: Any)/contains(elem: Any)— if the value can't possibly be in the list, it's a no-op, not a type error.add,prepend,concat) widen the element type, matching Scala's::[B >: A]/++[B >: A]—List<A> + BproducesList<A | B>.reduce/reduceRightaccept a wider accumulator type, matching Scala'sreduce[B >: A].