자릿수 더하기

hapwoo·2022년 8월 17일
0

Coding test

목록 보기
16/18

https://school.programmers.co.kr/learn/courses/30/lessons/12931

function solution(n){
    return String(n).split("").map(x=>x*1).reduce((pre, cur)=>pre+cur, 0)
}
profile
프론트 개발자

0개의 댓글