code: function totalLength (arr) {
    if (!arr) {
      return 0;
    }
    var total = 0;
    arr.forEach(function (item) {
      var length = item.length;
      length = length ? length : 0;
      total += length;
    });
    return total;
  }
docs: Gets the sum of the length of the items of an array