https://programmers.co.kr/learn/courses/30/lessons/12947
function solution(x) {
const strNum = String(x); // "18"
let nSum = 0;
for (let i = 0; i < strNum.length; i++) {
nSum += Number(strNum[i]); // 9
}
let answer;
if (x % nSum === 0) {
answer = true;
} else {
answer = false;
}
return answer;
}