docs: function binSearch(test) {
          var i0 = 0;
          var i1 = array.length;
          while (i0 < i1 - 1) {
            var i = Math.trunc((i0 + i1) / 2);
            if (test(i))
              i1 = i;  // Explore the left branch.
            else
              i0 = i;  // Explore the right branch.
          }
          return i1;
        }