CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
max.js30 linesDownload Raw Back to lodash-es
1import baseExtremum from './_baseExtremum.js';2import baseGt from './_baseGt.js';3import identity from './identity.js';4 5/**6 * Computes the maximum value of `array`. If `array` is empty or falsey,7 * `undefined` is returned.8 *9 * @static10 * @since 0.1.011 * @memberOf _12 * @category Math13 * @param {Array} array The array to iterate over.14 * @returns {*} Returns the maximum value.15 * @example16 *17 * _.max([4, 2, 8, 6]);18 * // => 819 *20 * _.max([]);21 * // => undefined22 */23function max(array) {24  return (array && array.length)25    ? baseExtremum(array, identity, baseGt)26    : undefined;27}28 29export default max;30 
basant307/AI_Governance_Project · CoolFace