1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-08 09:38:04 +00:00

Add Random Cannot Be Seeded As a javascript til

This commit is contained in:
jbranchaud
2016-02-01 22:25:23 -06:00
parent b85df0ed65
commit b1ba4e41ef
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
# Random Cannot Be Seeded
In JavaScript, you can use `Math.random()` to get a *sorta* random value.
```javascript
> Math.random()
0.5130641541909426
```
Most programming languages give you a method of seeding the random number
generator for determinism. Unfortunately, JavaScript provides no way for
choosing or resetting the seed to `Math.random()`.
[source](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random)