We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Check if sorted array has a value using binary search.
function hasValue(x, v, fc, fm) // x: a sorted array // v: search value // fc: compare function (a, b) // fm: map function (v, i, x)
const xsortedArray = require('extra-sorted-array'); var x = [10, 20, 20, 40, 40, 80]; xsortedArray.hasValue(x, 30); // → false xsortedArray.hasValue(x, 40); // → true