Fully renamed and updated everything, tagged, built
This commit is contained in:
10
snippets/randomNumberInRange.md
Normal file
10
snippets/randomNumberInRange.md
Normal file
@ -0,0 +1,10 @@
|
||||
### randomNumberInRange
|
||||
|
||||
Returns a random number in the specified range.
|
||||
|
||||
Use `Math.random()` to generate a random value, map it to the desired range using multiplication.
|
||||
|
||||
```js
|
||||
const randomNumberInRange = (min, max) => Math.random() * (max - min) + min;
|
||||
// randomInRange(2,10) -> 6.0211363285087005
|
||||
```
|
||||
Reference in New Issue
Block a user