<reponame>joejames0830/ps_study<filename>Programmers/week3/add_digits.js<gh_stars>0function solution(n)
{
    var answer = 0;
    let text=n.toString();
    let arr=text.split('');
    
    for(i=0;i<arr.length;i++){
        answer += Number(arr[i]);
    }
    return answer;
}