Get index of first value in sorted array.
Use binarySearch, if index of value is needed.
const binarySearch = ;// binarySearch(<array>, <value>, [compare function], [this], [begin=0], [end])// -> <first index of value> | ~<index of closest value> ;// 2;// -3 (-ve => not found, closest: ~(-3) = 2);// 2 ;// 1;// -2 (-ve => not found, closest: ~(-2) = 1);// 1
With extra-array try
Array.binarySearch.first()
instead.