JSPM

@writetome51/get-random-integer-s

2.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q36713F
  • License MIT

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

Package Exports

  • @writetome51/get-random-integer-s

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@writetome51/get-random-integer-s) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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';