extender icon indicating copy to clipboard operation
extender copied to clipboard

reduce() not works

Open msongz opened this issue 1 year ago • 1 comments

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);

msongz avatar Oct 30 '22 09:10 msongz

This is an issue with babel-preset-extenscript, where the initial value of reduce gets removed.

Klustre avatar Nov 01 '22 09:11 Klustre