Hi i recently did a number generator and i have an array filled with 0, 0, 0, 0, 0, because it generates numbers from 0 - 99999 and i want to make it replace only a few elements, for example if it generates 123 then i want an array to be [0, 0, 1, 2, 3], if 4467 then [0, 4, 4, 6, 7] etc any suggestions? thats the code i have for array:
let randInt = Math.floor(Math.random() * 100000);
let separated = [0, 0, 0, 0, 0];
separated = Array.from(String(randInt), Number);
/and modulo%will help. The other possibility is to userandInt.toString().split("")and then add the missing zeros at the beginning of the arrayradInt.toString().padStart(5, 0).split('').map(Number)