UNPKG

just-animate

Version:
10 lines (9 loc) 247 B
const rdm = Math.random; const flr = Math.floor; export function random(first, last, suffix, round) { let val = first + rdm() * (last - first); if (round === true) { val = flr(val); } return !suffix ? val : val + suffix; }