Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions JavaScript/3-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ class Counter {
[Symbol.asyncIterator]() {
const end = this.end;
let i = this.begin;
const step = this.step;
const iterator = {
async next() {
return {
value: i++,
done: i > end
const item = {
value: i,
done: i >= end
};
i += step;
return item;
}
};
return iterator;
Expand Down