Skip to content

Commit e18e7de

Browse files
authored
Merge pull request #1 from believerilya/master
Increment step argument
2 parents 6b32b1d + 1b6f838 commit e18e7de

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

JavaScript/3-class.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ class Counter {
99
[Symbol.asyncIterator]() {
1010
const end = this.end;
1111
let i = this.begin;
12+
const step = this.step;
1213
const iterator = {
1314
async next() {
14-
return {
15-
value: i++,
16-
done: i > end
15+
const item = {
16+
value: i,
17+
done: i >= end
1718
};
19+
i += step;
20+
return item;
1821
}
1922
};
2023
return iterator;

0 commit comments

Comments
 (0)