function solution14(n) {
let sum = 0;
const newStr = n.toString();
for (let i = 0; i < newStr.length; i++) {
sum += Number(newStr[i]);
}
return n % sum === 0 ? true : false;
}
console.log(solution14(10)); // true
console.log(solution14(12)); // true
console.log(solution14(11)); // false
console.log(solution14(13)); // false