First, the integer is converted string & then to array. Using map function,
individual strings are converted to numbers with the help of parseInt function.
Finally, that array is returned as the result.
const digitize = n => [...`${n}`].map(i => parseInt(i));