UNPKG

@compactjs/random

Version:

Simple module to generate random values from a given range or array

3 lines (2 loc) 260 B
var a=function(a,n){return void 0===a?Math.random():void 0===n?Math.random()*a:a>n?Math.random()*(a-n)+n:Math.random()*(n-a)+a},n=function(a){return a[Math.floor(Math.random()*a.length)]};export{n as pick,a as random}; //# sourceMappingURL=index.modern.js.map