Skip to content

2 functions: one gives you 1 random integer within a chosen range, the other gives you many.

License

Notifications You must be signed in to change notification settings

writetome51/get-random-integer-s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

getRandomInteger([min, max]): number

getRandomIntegers(
     howMany,
     [min, max]
): number[]

Examples

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

import { getRandomInteger, getRandomIntegers} from '@writetome51/get-random-integer-s';

About

2 functions: one gives you 1 random integer within a chosen range, the other gives you many.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published