Skip to content

Commit 739b356

Browse files
ininja1tshemsedinov
authored andcommitted
Fix class example, use step
1 parent 62511dc commit 739b356

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

JavaScript/3-class.js

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

0 commit comments

Comments
 (0)