Skip to content

Commit fc56d3d

Browse files
committed
fix: avoid confusion
1 parent f429f38 commit fc56d3d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

F25/koans/the_same_picture/byo_generator.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ for(const n of generator1) { // 4, ..., 10
3434
console.log(n)
3535
}
3636

37+
console.log(`-------------------------------------`)
38+
3739
/*
3840
Do we need TypeScript to do this for us, or is it something we could do ourselves?
3941
Here's a version that we build ourselves. It's missing some features (like the yield
@@ -61,9 +63,11 @@ const gen1 = buildOneToTen()
6163
const gen2 = buildOneToTen()
6264

6365
console.log(gen1())
64-
console.log(gen2())
6566
console.log(gen1())
6667
console.log(gen2())
68+
console.log(gen2())
69+
70+
console.log(`-------------------------------------`)
6771

6872
/** That's a little restrictive, though. What if we wanted a generator that starts
6973
* and ends in a different place? We'd need to give some more arguments to the builder
@@ -83,9 +87,10 @@ const gen3 = buildOneToTenCustom(5,6)
8387
const gen4 = buildOneToTenCustom(4, 10)
8488

8589
console.log(gen3())
86-
console.log(gen4())
8790
console.log(gen3())
8891
console.log(gen4())
92+
console.log(gen4())
93+
console.log(`-------------------------------------`)
8994

9095
/** Think about what you know of OO in Java. Objects have constructors, and often have
9196
* internal state. There's a strong parallel between creating objects in Java and what

0 commit comments

Comments
 (0)