title: Make array consecutive
body: <p>i got stucked in a chalenge in codeFights.my code pass the simple test and fail in just 2 from five of hidden tests her is the chalenge instruction:</p>
  
  <p>Ratiorg got statues of different sizes as a present from CodeMaster for his birthday, each statue having an non-negative integer size. Since he likes to make things perfect, he wants to arrange them from smallest to largest so that each statue will be bigger than the previous one exactly by 1. He may need some additional statues to be able to accomplish that. Help him figure out the minimum number of additional statues needed.</p>
  
  <pre><code>Example
  
  For statues = [6, 2, 3, 8], the output should be
  makeArrayConsecutive2(statues) = 3.
  
  Ratiorg needs statues of sizes 4, 5 and 7.
  
  Input/Output
  
  [time limit] 4000ms (js)
  [input] array.integer statues
  
  An array of distinct non-negative integers.
  
  Constraints:
  1 ≤ statues.length ≤ 10,
  0 ≤ statues[i] ≤ 20.
  
  [output] integer
  </code></pre>
  
  <p>The minimal number of statues that need to be added to existing statues such that it contains every integer size from an interval [L, R] (for some L, R) and no other sizes.</p>
  
  <p>and here is my code :</p>
  
  <pre><code>function makeArrayConsecutive2(statues) {
   //range the table from min to max
   var rang=statues.sort();
   var some=0;
   //if the table is one element
   if(rang.length-1==0){
    return 0;
  
   }else{
    //if the table contain more then one element
    for(i=0;i&lt;=rang.length-2;i++){
     //add the deference of two consecutive position -1 
     //to find the number of missing numbers
     some+=(rang[i+1]-rang[i]-1);
   }
    return some;
   }
  }
  </code></pre>