This recursive sum overflows the call stack on a large array. Which rewrite reliably avoids the RangeError in V8?const sum = arr => arr.length === 0 ? 0 : arr[0] + sum(arr.slice(1)); sum(new Array(100000).fill(1)); // RangeError