✏️ 编辑:_baseExtremum.js
路径:
/home/boguraj1/public_html/jobsite/node_modules/lodash/_baseExtremum.js
大小:897 B · 修改:2022-11-21 20:09:36 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
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;
💾 保存
取消
保存为 UTF-8,换行统一为 LF