leebyron / ecmascript-iterator-hof

Higher Order Functions on Iterators
42 stars 2 forks source link

Should transforms operate on "completion value"? #3

Closed RangerMauve closed 7 years ago

RangerMauve commented 7 years ago

The new for ... of syntax ignores the completion value, so it would make sense to ignore it for the different functions introduced here.

function *example(){
 yield 1;
 yield 2;
 return 3;
}

for(let i of example()) console.log(i);

Outputs

1
2
leebyron commented 7 years ago

Yeah that's very likely correct, completion values should be ignored.