UNPKG

chertoperter

Version:

Fake data generator for Persian developers

9 lines (8 loc) 357 B
const randomItem = (arr) => arr[Math.floor(Math.random() * arr.length)]; const numberByRange = (from, to) => { return Math.floor(Math.random() * (to - from + 1)) + from; }; function randomNumberString(length) { return Array.from({ length }, () => Math.floor(Math.random() * 10)).join(''); } export { numberByRange, randomItem, randomNumberString };