Skip to content

Commit 4d0ceef

Browse files
authored
Update article.md
"yield is a two-way road" -> "yield is a two-way street" "Two way street" is by far the more common and accepted way to say this. If you look up "two-way road" you will typically be redirected to "two-way street".
1 parent 6994fc0 commit 4d0ceef

File tree

1 file changed

+2
-2
lines changed
  • 1-js/12-generators-iterators/1-generators

1 file changed

+2
-2
lines changed

1-js/12-generators-iterators/1-generators/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ alert(str); // 0..9A..Za..z
314314

315315
A generator composition is a natural way to insert a flow of one generator into another. It doesn't use extra memory to store intermediate results.
316316

317-
## "yield" is a two-way road
317+
## "yield" is a two-way street
318318

319319
Until this moment, generators were similar to iterable objects, with a special syntax to generate values. But in fact they are much more powerful and flexible.
320320

321-
That's because `yield` is a two-way road: it not only returns the result outside, but also can pass the value inside the generator.
321+
That's because `yield` is a two-way street: it not only returns the result outside, but also can pass the value inside the generator.
322322

323323
To do so, we should call `generator.next(arg)`, with an argument. That argument becomes the result of `yield`.
324324

0 commit comments

Comments
 (0)