code: function binSearch2(xs, pred) {
        var a, b, mid;
  
        a = -1;
        b = xs.length - 1;
        while (b - a > 1) {
           mid = Math.floor((a + b) / 2);
           if (pred(xs[mid])) {
              b = mid;
           } else {
              a = mid;
           }
        }
        return b;
  
     }
docs: /*
  Given an array of xs, and a predicate on those values,
  supposing the predicate is false on some initial portion of the
  array and true elsewhere, the function returns the smallest index
  where the predicate is true.  If the predicate is always false,
  returns the last index.