title: javaScript - Find the sum of all divisors of a given integer
body: <p>i'm doing some coding exercises and i'm not being able to solve this one.</p>
  
  <p>Find the sum of all divisors of a given integer.
  For n = 12, the  input should be
  sumOfDivisors(n) = 28.</p>
  
  <p>example: 1 + 2 + 3 + 4 + 6 + 12 = 28.</p>
  
  <p>Constraints:
  1 ≤ n ≤ 15.</p>
  
  <p>how can i solve this exercise? i'm not being able to.</p>
  
  <pre><code>function(n){
      var arr = [],
          finalSum;
  
      if(n &lt;= 1 || n =&gt; 16){
         return false ;   
     }
     for(var i = 0; i &lt; 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;
  }
  </code></pre>