i'm doing some coding exercises and i'm not being able to solve this one.
Find the sum of all divisors of a given integer. For n = 12, the input should be sumOfDivisors(n) = 28.
example: 1 + 2 + 3 + 4 + 6 + 12 = 28.
Constraints: 1 ≤ n ≤ 15.
how can i solve this exercise? i'm not being able to.
function(n){
    var arr = [],
        finalSum;
    if(n <= 1 || n => 16){
       return false ;   
   }
   for(var i = 0; i < n; i++){
       var tmp= n/2;
       arr.push(tmp)    
       // i need to keep on dividing n but i can't get the way of how to
   }
  return finalSum;
}