function solution(n) {
var answer = 0;
answer=getMeasures(n).reduce((a,b)=>a+b);
return answer;
}
function getMeasures(num){
const measures=[num]
if(num===1||num===0)
return measures;
for(let i=0;i<=num/2+1;i++){
if(num%i===0)
measures.push(i);
}
return measures;
}
예외처리 주의