https://github.com/writetome51/get-random-integer-s
2 functions: one gives you 1 random integer within a chosen range, the other gives you many.
https://github.com/writetome51/get-random-integer-s
integers javascript number random-number-generators typescript
Last synced: 2 months ago
JSON representation
2 functions: one gives you 1 random integer within a chosen range, the other gives you many.
- Host: GitHub
- URL: https://github.com/writetome51/get-random-integer-s
- Owner: writetome51
- License: mit
- Created: 2018-10-05T23:26:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-12T17:40:23.000Z (about 5 years ago)
- Last Synced: 2026-01-02T03:49:26.420Z (7 months ago)
- Topics: integers, javascript, number, random-number-generators, typescript
- Language: JavaScript
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# getRandomInteger([min, max]): number
# getRandomIntegers(
howMany,
[min, max]
): number[]
## Examples
```js
console.log(getRandomInteger([-5, 5]));
// 3
console.log(getRandomIntegers(5, [-5, 5]));
// [ -2, 1, -2, -3, 1 ]
console.log(getRandomInteger([0, 10]));
// 1
console.log(getRandomIntegers(5, [0, 10]));
// [ 3, 1, 10, 8, 3 ]
```
## Installation
`npm i @writetome51/get-random-integer-s`
## Loading
```js
import { getRandomInteger, getRandomIntegers} from '@writetome51/get-random-integer-s';
```