Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

first digit javascript

function solution(inputString) {
    let firstDigit = inputString.match(/d/);
    return firstDigit ? firstDigit[0] : '0';
}
 
PREVIOUS NEXT
Tagged: #digit #javascript
ADD COMMENT
Topic
Name
2+2 =