Answers for "how to split numbers in js and add them"

3

split the numbers js

var num = 123456;
var digits = num.toString().split('').map(iNum => parseInt(iNum, 10));
console.log(digits);
Posted by: Guest on February-29-2020

Code answers related to "how to split numbers in js and add them"

Code answers related to "Javascript"

Browse Popular Code Answers by Language