Callback that exposes an element's searchable range.
Write inclusive lower and upper bounds into the provided range array. The array is reused by search helpers to avoid allocating a new tuple for each inspected item.
range
const getRange: SearchRangeCallback<{ start: number; end: number }> = ( range, item) => { range[0] = item.start; range[1] = item.end;}; Copy
const getRange: SearchRangeCallback<{ start: number; end: number }> = ( range, item) => { range[0] = item.start; range[1] = item.end;};
Range element type.
Writes the element's inclusive range bounds into range.
Mutable two-item array receiving [start, end].
[start, end]
Element being inspected.
Element index.
Callback that exposes an element's searchable range.
Remarks
Write inclusive lower and upper bounds into the provided
rangearray. The array is reused by search helpers to avoid allocating a new tuple for each inspected item.Example