You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"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".
Copy file name to clipboardExpand all lines: 1-js/12-generators-iterators/1-generators/article.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -314,11 +314,11 @@ alert(str); // 0..9A..Za..z
314
314
315
315
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.
316
316
317
-
## "yield" is a two-way road
317
+
## "yield" is a two-way street
318
318
319
319
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.
320
320
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.
322
322
323
323
To do so, we should call `generator.next(arg)`, with an argument. That argument becomes the result of `yield`.
0 commit comments