committed by
GitHub
parent
20d2b4f98d
commit
e4f3964f67
4
node_modules/underscore/cjs/max.js
generated
vendored
4
node_modules/underscore/cjs/max.js
generated
vendored
@ -7,7 +7,7 @@ var each = require('./each.js');
|
||||
function max(obj, iteratee, context) {
|
||||
var result = -Infinity, lastComputed = -Infinity,
|
||||
value, computed;
|
||||
if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
|
||||
if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {
|
||||
obj = _isArrayLike(obj) ? obj : values(obj);
|
||||
for (var i = 0, length = obj.length; i < length; i++) {
|
||||
value = obj[i];
|
||||
@ -19,7 +19,7 @@ function max(obj, iteratee, context) {
|
||||
iteratee = _cb(iteratee, context);
|
||||
each(obj, function(v, index, list) {
|
||||
computed = iteratee(v, index, list);
|
||||
if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
|
||||
if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) {
|
||||
result = v;
|
||||
lastComputed = computed;
|
||||
}
|
||||
|
Reference in New Issue
Block a user