lower-bound
Finds the first item in a sorted array greater than or equal to a value.
DEPRECATED
Use binary-search-bounds instead.
Use
First install using npm:
npm install lower-bound
Then use as follows:
var lb = console // Prints 1console // Prints 3
require("lower-bound")(array, value[, compare, lo, hi])
Uses a binary search to find the first item which is >= to value in array.
array
a sorted list of itemsvalue
the item to findcompare
a comparison function (optional)lo
a lower bound to search on (optional)hi
an upper bound on the range to search on (optional)
Credits
(c) 2013 Mikola Lysenko. MIT License