function solution(x) { let answer = true; let sum = 0; const arr = x.toString().split(''); for(let i in arr){ sum += Number(arr[i]); } x % sum == 0 ? answer = true : answer = false return answer; }
성공