function baseFlatten(array, isDeep, isStrict, fromIndex) {
      var index = (fromIndex || 0) - 1,
          length = array.length,
          resIndex = -1,
          result = [];

      while (++index < length) {
        var value = array[index];

        if (value && typeof value == 'object' && typeof value.length == 'number'
            && (isArray(value) || isArguments(value))) {
          // recursively flatten arrays (susceptible to call stack limits)
          if (isDeep) {
            value = baseFlatten(value, isDeep, isStrict);
          }
          var valIndex = -1,
              valLength = value.length;

          result.length += valLength;
          while (++valIndex < valLength) {
            result[++resIndex] = value[valIndex];
          }
        } else if (!isStrict) {
          result[++resIndex] = value;
        }
      }
      return result;
    }
The base implementation of `_.flatten` with added support for restricting
flattening and specifying the start index.

@private
@param {Array} array The array to flatten.
@param {boolean} [isDeep=false] Specify a deep flatten.
@param {boolean} [isStrict=false] Restrict flattening to arrays and `arguments` objects.
@param {number} [fromIndex=0] The index to start from.
@returns {Array} Returns the new flattened array.