indexOfEquivalent Method
Find the index of an element that compares as equivalent based on some criterion. If multiple elements are equivalent, the specific one returned is unspecified.
As an example, consider a SortedArray<ModelState>
which uses ModelState.id
as its ordering criterion. To find the index of a model by its Id,
use sortedArray.indexOfEquivalent((element) => compareStrings(element.id, modelId))
where modelId
is an Id64String.
indexOfEquivalent(criterion: (element: T) => number): number
@returns The index of the first element found that meets the criterion, or -1 if no elements meet the criterion.
Returns - number
The index of the first element found that meets the criterion, or -1 if no elements meet the criterion.
Defined in
- core/bentley/src/SortedArray.ts Line 175
Last Updated: 17 December, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.