code: function boot(nboot, bootfun) {
    var data = [];
    for (var i = 2; i < arguments.length; ++i) {
      data[i - 2] = arguments[i];
    }
    var sample = [];
    for (var i = 0; i < data.length; ++i) {
      sample[i] = data[i].slice(0);
    }
    var n = data[0].length;
    var res = Array(nboot);
    for (var i = 0; i < nboot; ++i) {
      for (var j = 0; j < n; ++j) {
        var idx = Math.floor(n * Math.random());
        for (var k = 0; k < sample.length; ++k) {
          sample[k][j] = data[k][idx];
        }
      }
      res[i] = bootfun.apply(null, sample);
    }
    return res;
  }
docs: Efron, B. Bootstrap Methods: Another Look at the Jackknife. The Annals of Statistics 7 (1979), no. 1, 1--26. doi:10.1214/aos/1176344552. http://projecteuclid.org/euclid.aos/1176344552.