Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert number to array javascript

const numToSeparate = 12345;

const arrayOfDigits = Array.from(String(numToSeparate), Number);

console.log(arrayOfDigits);   //[1,2,3,4,5]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #number #array #javascript
ADD COMMENT
Topic
Name
8+7 =