convert numbers to array code example
Example 1: convert number to array javascript
const numToSeparate = 12345;
const arrayOfDigits = Array.from(String(numToSeparate), Number);
console.log(arrayOfDigits); //[1,2,3,4,5]
Example 2: convert array to number
let x = [1,2,3,4,5]
let num = +x.join("")