>>101574765
const x = [1,2,3,4];
const y = x.reduce(
(acc, val) => acc + val * val,
0
);
console.log(y);
function* myIterator() {
for (let i = 1; i < 5; i++) yield i;
return 5;
}
const it = myIterator();
const z = it.reduce(
(acc, val) => acc + val * val,
0
);
console.log(z);