Answers for "how to split amount by , in js"

5

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
0

split string based on length in javascript

"123456789".match(/.{1,2}/g);
// Results in:
["12", "34", "56", "78", "9"]
Posted by: Guest on October-22-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language