You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I click "Options" there are a few compiler flags that the user can check to enable. Adding "downlevelIteration" as one of the options would let me try out custom generators when transpiling to ES5.
Currently when trying to run the fibonacci generator code sample from the for...of docs:
function* fibonacci() { // a generator function
let [prev, curr] = [0, 1];
while (true) {
[prev, curr] = [curr, prev + curr];
yield curr;
}
}
for (let n of fibonacci()) {
console.log(n);
// truncate the sequence at 1000
if (n >= 1000) {
break;
}
}
the playground shows this error: Type 'IterableIterator<number>' is not an array type or a string type.
The text was updated successfully, but these errors were encountered:
DanielRosenwasser
added
Website
Deprecated - please forward issue to microsoft/TypeScript-Website
and removed
Docs
The issue relates to how you learn TypeScript
labels
Oct 18, 2017
When I click "Options" there are a few compiler flags that the user can check to enable. Adding "downlevelIteration" as one of the options would let me try out custom generators when transpiling to ES5.
Currently when trying to run the fibonacci generator code sample from the for...of docs:
the playground shows this error:
Type 'IterableIterator<number>' is not an array type or a string type.
The text was updated successfully, but these errors were encountered: