I am convinced that the best investment is an investment in knowledge. That is why I am constantly learning: mastering new technologies, taking courses, practicing and experimenting. I believe that even small steps in learning lead to big results.
function digitize(n) {
let arrayOfNumbers = [];
if (n === 0) {
arrayOfNumbers.push(0);
return arrayOfNumbers;
}
while (n) {
arrayOfNumbers.push(n % 10);
n = Math.floor(n / 10);
}
return arrayOfNumbers;
}
A2