If you have an array containing an indefinite amount of arrays
ex:
var masterArray = [ [1,2,3,4,5], [1,2], [1,1,
Sort a list of indexes by length in descending order, and take the first one:
a.map((e, i) => i) . sort((i, j) => a[j].length - a[i].length) [0]