Здесь мы будем генерировать случайное количество 9 цифр с помощью JS.
function getRandom(length) {
return Math.floor(Math.pow(10, length-1) + Math.random() * 9 * Math.pow(10, length-1));
}
getRandom(9)
Выход:
234664534
Оригинал: “https://dev.to/chauchausoup/random-number-generation-in-js-18fi”