calculateNearestIndex()
function calculateNearestIndex(values, target): number;
Finds the index of the value in values nearest to target.
Parameters
| Parameter | Type | Description |
|---|---|---|
values | string[] | number[] | Float64Array<ArrayBufferLike> | Array of numeric values. |
target | string | number | Target value to find. |
Returns
number
Index of the nearest value.