const list = [1, 1, 2, 1, 3, 4, 1, 1, 1, 1, 1];
const result: number[] = [];
const i = findIndexRight(list, (v) => (result.push(v), v === 4));
i; // 5
result; // [1, 1, 1, 1, 1, 4]
findIndexRight([{ v: 1 }, { v: 2 }], (v) => v.v === 4); // -1
findIndexRight([{ v: 1 }, { v: 2 }], (v) => v.v === 2); // 1
findIndexRight([], undefined as any); // -1
findIndex反向遍历版本