Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1b6f838

Browse files
committed
step fix
1 parent 6b32b1d commit 1b6f838

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+
constitem= {
16+
value: i,
17+
done: i >= end
1718
};
19+
i += step;
20+
return item;
1821
}
1922
};
2023
return iterator;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /