_.min(list, [iteratee], [context])
返回list中的最小值。
_.min([1, 2, 3]); //=> 1
_.min({a:1, b:2, c:3}); //=> 1
_.min('123'); //=> '1'
var min = _.min([1, 2, 3], function(n){
return -n; //-3最小,作为最小值的依据。
});
console.log(min); //=> 3
var min = _.min(['aaa', 'bb', 'c'], 'length');
console.log(min); //=> 'c'
var arr = [{name: 'iro', age : 15}, {name: 'moe', age : 20}, {name: 'kyo', age : 18}]
var min = _.min(arr, 'age');
console.log(min); //=> Object {name: "iro", age: 15}
var min = _.min([1, 2], function (n) {
console.log(this); //=> Object {no: 5}
return this.no - n;
}, {no : 5});
_.min(null); //=> Infinity
_.min(undefined); //=> Infinity
_.min(null, undefined); //=> Infinity
_.min(Infinity); //=> Infinity
_.min(true); //=> Infinity
_.min(false); //=> Infinity
_.min([]); //=> Infinity
_.min({}); //=> Infinity
_.min(1); //=> Infinity
_.min({'a': 'a'}); //=> Infinity
_.min(1, 'abc'); //=> Infinity
var array = [11121, 2312, 5, 313119];
var result = (function(){
//写下你的代码
}(array));
console.log(result); //=> 11121