Sha256: eab78bd35b0007c2344af41ed62d2fa3a0db06ecde0ffaaebd6382aeefe0a9df

Contents?: true

Size: 822 Bytes

Versions: 153

Compression:

Stored size: 822 Bytes

Contents

/**
 * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
 * with one argument: (value).
 *
 * @private
 * @param {Array} array The array to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @param {Function} comparator The function used to compare values.
 * @param {*} exValue The initial extremum value.
 * @returns {*} Returns the extremum value.
 */
function arrayExtremum(array, iteratee, comparator, exValue) {
  var index = -1,
      length = array.length,
      computed = exValue,
      result = computed;

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

    if (comparator(current, computed)) {
      computed = current;
      result = value;
    }
  }
  return result;
}

module.exports = arrayExtremum;

Version data entries

153 entries across 80 versions & 8 rubygems

Version Path
trusty-festivity-extension-2.5.18 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.18 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.17 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.17 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.16 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.16 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.15 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.15 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.14 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.14 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.13 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.13 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.12 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.12 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.11 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.11 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.10 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.10 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.9 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
trusty-festivity-extension-2.5.9 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js