Sha256: b768c0721157f9e925141837698c459edd2c1dbdd43a821cc14d3b1f97751b3a
Contents?: true
Size: 897 Bytes
Versions: 302
Compression:
Stored size: 897 Bytes
Contents
var isSymbol = require('./isSymbol'); /** * The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Function} comparator The comparator used to compare values. * @returns {*} Returns the extremum value. */ function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : comparator(current, computed) )) { var computed = current, result = value; } } return result; } module.exports = baseExtremum;
Version data entries
302 entries across 279 versions & 33 rubygems