Fix name of JavaScript
This commit is contained in:
parent
3b14ed8185
commit
c5ce5578fc
32 changed files with 61 additions and 61 deletions
|
|
@ -5,7 +5,7 @@ There are many areas where we need random data.
|
|||
|
||||
One of them is testing. We may need random data: text, numbers etc, to test things out well.
|
||||
|
||||
In Javascript, we could use `Math.random()`. But if something goes wrong, we'd like to be able to repeat the test, using exactly the same data.
|
||||
In JavaScript, we could use `Math.random()`. But if something goes wrong, we'd like to be able to repeat the test, using exactly the same data.
|
||||
|
||||
For that, so called "seeded pseudo-random generators" are used. They take a "seed", the first value, and then generate next ones using a formula. So that the same seed yields the same sequence, and hence the whole flow is easily reproducible. We only need to remember the seed to repeat it.
|
||||
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ If we don't catch the error there, then, as usual, it falls through to the outer
|
|||
- Inside generators (only) there exists a `yield` operator.
|
||||
- The outer code and the generator may exchange results via `next/yield` calls.
|
||||
|
||||
In modern Javascript, generators are rarely used. But sometimes they come in handy, because the ability of a function to exchange data with the calling code during the execution is quite unique.
|
||||
In modern JavaScript, generators are rarely used. But sometimes they come in handy, because the ability of a function to exchange data with the calling code during the execution is quite unique.
|
||||
|
||||
Also, in the next chapter we'll learn async generators, which are used to read streams of asynchronously generated data in `for` loop.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue