I have a question.
If I get "10S2D*3T" string, I have to divide number and not number like that.
What I want to do
INPUT
"10S2D*3T"
OUTPUT
[10, 'S', 2, 'D','*',3,'T']
It's my result
function solution(dartResult) {
var answer = 0;
var point = dartResult.split(/\D/gi);
var option = dartResult.split(/\d/gi);
console.log(point);
console.log(option);
return answer;
}
console.log(solution("10S2D*3T"));
Dand*are not numbers and are separated in the result.