Answers for "split string on number and letters javascript"

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

JavaScript Split the string into an array of characters

// split the text into array of chars using empty string
console.log("ABCDEFGHIJK".split(''));

// split the text into array of chars using empty string and limit to 3 chars
console.log("ABCDEFGHIJK".split('', 3));
Posted by: Guest on November-29-2021

Code answers related to "split string on number and letters javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language