let so = ['O', 'S', 'O', 'S', 'O', 'S', 'O', 'O', 'S', 'O', 'S', 'S', 'O', 'S', 'O', 'O' ];
let soi = [];
so.reduce(
function(prev, current, index, arr) {
if(prev == current)
soi.push([current, index - 1, index]);
return current;
}
);
console.log(soi);