3 var toPosInt = require('../../number/to-pos-integer')
4 , callable = require('../../object/valid-callable')
5 , value = require('../../object/valid-value')
9 module.exports = function (compareFn) {
10 var length, low, high, middle;
15 length = toPosInt(this.length);
20 middle = floor((low + high) / 2);
21 if (compareFn(this[middle]) < 0) high = middle - 1;
22 else low = middle + 1;
25 if (high < 0) return 0;
26 if (high >= length) return length - 1;