findEquivalent Method
Find 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 a model by its Id,
use sortedArray.findEquivalent((element) => compareStrings(element.id, modelId))
where modelId
is an Id64String.
findEquivalent(criterion: (element: T) => number): undefined | T
see ReadonlySortedArray.indexOfEquivalent.
Returns - undefined | T
The first element found that meets the criterion, or undefined
if no elements meet the criterion.
Defined in
- core/bentley/src/SortedArray.ts Line 163
Last Updated: 30 November, 2023