constructor MethodProtected

Construct a new ReadonlySortedArray.

ReadonlySortedArray<T>(compare: OrderedComparator<T, T>, duplicatePolicy: boolean | DuplicatePolicy = false, clone: CloneFunction<T> = shallowClone): ReadonlySortedArray<T>

Parameter Type Description
compare OrderedComparator<T, T> The function used to compare elements within the array.
duplicatePolicy boolean | DuplicatePolicy Policy for handling attempts to insert a value when an equivalent value already exists. If the input is a boolean, then true indicates DuplicatePolicy.Allow, and false indicates DuplicatePolicy.Retain.
clone CloneFunction<T> The function invoked to clone a new element for insertion into the array. The default implementation simply returns its input.

Returns - ReadonlySortedArray<T>

Defined in

Last Updated: 30 November, 2023