summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/prototype/reduce/no-initial-value-set-accumulator-to-first-value.js
blob: a2b0008e6a17300a42b1baf0f03864d41c24ca56 (plain)
1
2
3
4
5
6
7
8
9
// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally

const reducer = (acc, value) => acc;
const iterator = [1, 2, 3].values();

assertEq(iterator.reduce(reducer), 1);

if (typeof reportCompare === 'function')
  reportCompare(0, 0);