We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6c9c47 commit 1d24255Copy full SHA for 1d24255
generators.js
@@ -1,3 +1,8 @@
1
+/**
2
+ * Generators are functions which can be paused and resumed later. Function
3
+ * context is saved across resumes.
4
+ */
5
+
6
function* count(){
7
var start = 0;
8
while(true) {
@@ -11,4 +16,4 @@ var iterator = count();
11
16
iterator.next(); //{value: 0, done: false}
12
17
iterator.next(); //{value: 1, done: false}
13
18
iterator.next(); //{value: 2, done: false}
14
-iterator.next(); //{value: 3, done: false}
19
+iterator.return();
0 commit comments