var array = [[1,2,3,1,1,1,1,2,4],[4,2,1,1,1,1,3,4,4]],
searchIndex = function(arr) {
for(var i=0,arrIndex=0,maxIndex=0,startIndex=0,endIndex=0,l=arr.length; i<l; i++){
if(arr[i]===arr[i+1]) {
arrIndex++;
} else {
if(arrIndex > maxIndex) {
maxIndex = arrIndex;
endIndex = i;
}
arrIndex = 0;
}
}
startIndex = endIndex - maxIndex;
return [startIndex, endIndex];
}
console.log(searchIndex(array[0]));
console.log(searchIndex(array[1]));