If you have an array containing an indefinite amount of arrays
ex:
var masterArray = [ [1,2,3,4,5], [1,2], [1,1,
.reduce is the nicest way to do this:
.reduce
masterArray.reduce(function (pending, cur, index, ar) { ar[ pending ].length > cur.length ? pending : index }, 0);
Or with ES6:
masterArray.reduce((p, c, i, a) => a[p].length > c.length ? p : i, 0);