出自:https://stackoverflow.com/questions/36144406/how-to-early-break-reduce-method
const array = ['9', '91', '95', '96', '99'];
const x = array
.slice(0) // create copy of "array" for iterating
.reduce((acc, curr, i, arr) => {
if (i === 2) arr.splice(1); // eject early by mutating iterated copy
return (acc += curr);
}, '');
console.log("x: ", x, "\noriginal Arr: ", array);
具体原理不详。