You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
381 B
16 lines
381 B
var size = require('./size'); |
|
exports = function(arr) { |
|
if (arr.length < 1) return; |
|
var ret = arr[0], |
|
retSize = size(arr[0]); |
|
for (var i = 1, len = arr.length; i < len; i++) { |
|
var elSize = size(arr[i]); |
|
if (elSize > retSize) { |
|
ret = arr[i]; |
|
retSize = elSize; |
|
} |
|
} |
|
return ret; |
|
}; |
|
|
|
module.exports = exports;
|
|
|