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
@returns The first element found that meets the criterion, or undefined
if no elements meet the criterion.
@see 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: 23 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.