docs: function flatten(array) {
      var result = [], i, n;
  
      for (i = 0, n = array.length; i < n; i++) {
        if (isArray(array[i])) {
          result = result.concat(flatten(array[i]));
        }
        else {
          result.push(array[i]);
        }
      }
  
      return result;
    }