I'm attempting to store the individual digits of a large integer in an array by converting it to a string first and then using the 'split()' method. However, it seems that in JavaScript, this method only works for integers up to 15 digits. For numbers larger than that, I'm getting exponential notation like '2.1321321381211322e+27' which cannot be directly stored in an array by first converting it to a string and splitting it. Instead, it appears as:
2 . 6 5 2 5 2 8 5 9 8 1 2 1 9 1 0 3 e + 3 2
Does anyone know how to handle large numbers in this situation?
Here is my code:
const myNum = 2132132138121132132145463636;
let myNumArray = ((myNum.toString()).split(''));
console.log(myNumArray); //2 . 6 5 2 5 2 8 5 9 8 1 2 1 9 1 0 3 e + 3 2