【文件属性】:
文件名称:array-max:获取最大收藏价值
文件大小:5KB
文件格式:ZIP
更新时间:2021-06-04 15:13:02
JavaScript
阵列最大
获得最大的收藏价值。
安装
npm install arraymax
bower install array-max
用法
var max = require ( 'arraymax' ) ;
console . log ( max ( [ ] ) ) ; // -Infinity
console . log ( max ( [ 2 , 3 , 1 ] ) ) ; // 3
var col = [ { n : 2 } , { n : 3 } , { n : 1 } ] ;
var result = max ( col , function ( x ) {
return x . n ;
} ) ;
console . log ( result ) ; // {n:3}
console . log ( max ( col , 'n' ) ) ; // {n:3}
执照
麻省理
【文件预览】:
array-max-master
----array-max.js(850B)
----.jscsrc(118B)
----package.json(681B)
----test()
--------array-max.js(544B)
----LICENSE.md(1KB)
----.gitignore(1KB)
----CHANGELOG.md(149B)
----README.md(506B)
----bower.json(428B)
----.editorconfig(439B)
----.gitattributes(52B)