extender
extender copied to clipboard
reduce() not works
reduce() is compiled, but running with an error message
const array1 = [1, 2, 3, 4];
// 0 + 1 + 2 + 3 + 4
const initialValue = 0;
const sumWithInitial = array1.reduce(
(previousValue, currentValue) => previousValue + currentValue,
initialValue
);
alert(array1);
This is an issue with babel-preset-extenscript, where the initial value of reduce
gets removed.