title: I tried to filter null values.But,TypeError: Cannot read property 'length' of null
body: <p>It's a kata in codewars.There're an array of arrays.If you sort the arrays by their length,you will see,that their length-values are consecutive.But one array is missing.I tried to write a method, that return the length of the missing array.
  My method can get the true length of the missing array,but I get an error message about null value.Now,I have tried to  filter null values.</p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'length' of null at getLengthOfMissingArray 
         at begin
        at it
          at /runner/frameworks/javascript/cw-2.js:179:21
        at Promise._execute
        at Promise._resolveFromExecutor
        at new Promise
        at describe
                at Object.handleError
            at ContextifyScript.Script.runInThisContext
        at Object.exports.runInThisContext</p>
  </blockquote>
  
  <pre><code>function getLengthOfMissingArray(arrayOfArrays) {
    var str=[];
    if (arrayOfArrays=="")
      return 0;
    var Long=arrayOfArrays.length;
    for(var i=0;i&lt;Long;i++){
      if (arrayOfArrays[i]=="")
        return 0;
      else
        str.push(arrayOfArrays[i].length);
    }
    str.sort(function(a,b){return a&gt;b?1:-1});
    var sum=0,n=str.length;
    var totol=((str[0]+str[n-1])/2)*(n+1);
    for(var i=0;i&lt;str.length;i++){
      sum=sum+str[i];
    }
    return totol-sum;
  }
  </code></pre>