[go: nahoru, domu]

Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-karpenko committed Oct 4, 2016
0 parents commit 42eee76
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions generator-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use strict';

function* progression() {
for (let i = 0; true; i++) {
let newI = yield i;
if (newI) {
i = newI;
}
}
}

//var p = progression();
//
//console.log(p.next().value);
//console.log(p.next().value);
//console.log(p.next().value);
//console.log(p.next(10).value);

var arr = [];
for (let a of progression()) {
console.log(a);
if (a == 20000) {
let b = 1;
console.log(b);
break;
}
//arr.push(a);
}
console.log(arr.length);

//while (!p.next().done) {
// console.log(p.next().value);
//}

0 comments on commit 42eee76

Please sign in to comment.