diff --git a/max.js b/max.js deleted file mode 100644 index 1b1f074cf..000000000 --- a/max.js +++ /dev/null @@ -1,39 +0,0 @@ -import isSymbol from './isSymbol.js'; - -/** - * Computes the maximum value of `array`. If `array` is empty or falsey, - * `undefined` is returned. - * - * @since 0.1.0 - * @category Math - * @param {Array} array The array to iterate over. - * @returns {*} Returns the maximum value. - * @example - * - * max([4, 2, 8, 6]); - * // => 8 - * - * max([]); - * // => undefined - */ -function max(array) { - let result; - let index = -1; - const length = array ? array.length : 0; - - while (++index < length) { - let computed; - const value = array[index]; - - if (value != null && (computed === undefined - ? (value === value && !isSymbol(value)) - : (value > computed) - )) { - computed = value; - result = value; - } - } - return result; -} - -export default max; diff --git a/min.js b/min.js deleted file mode 100644 index 22c10c76a..000000000 --- a/min.js +++ /dev/null @@ -1,39 +0,0 @@ -import isSymbol from './isSymbol.js'; - -/** - * Computes the minimum value of `array`. If `array` is empty or falsey, - * `undefined` is returned. - * - * @since 0.1.0 - * @category Math - * @param {Array} array The array to iterate over. - * @returns {*} Returns the minimum value. - * @example - * - * min([4, 2, 8, 6]); - * // => 2 - * - * min([]); - * // => undefined - */ -function min(array) { - let result; - let index = -1; - const length = array ? array.length : 0; - - while (++index < length) { - let computed; - const value = array[index]; - - if (value != null && (computed === undefined - ? (value === value && !isSymbol(value)) - : (value < computed) - )) { - computed = value; - result = value; - } - } - return result; -} - -export default min;