Is there a way to seperate a string into an array based on value? For example if I have a string "1119994444455" how would I turn that into [111, 999,44444,55]? I've attempted doing this but my method doesn't seem to be working.
my code:
var nums = [];
for(i in input){
i = parseInt(i);
if(i - beforeI != 0 && beforeI >= 0){
insertionIndex++;
}
nums[insertionIndex] += i.toString();
console.log(nums[insertionIndex]);
var beforeI = i
}