【文件属性】:
文件名称:compact-array:仅返回具有“非空”值的数组
文件大小:5KB
文件格式:ZIP
更新时间:2021-06-20 16:05:47
JavaScript
紧凑阵列
仅返回具有非空值的数组。
安装
npm install compact-array
bower install compact-array
用法
var compact = require ( 'compact-array' ) ;
var array = [
'b' ,
null ,
false ,
1 ,
0 ,
'' ,
[ 'lolz' , null , [ 'a' , 4 , null ] , undefined ]
] ;
console . log ( compact ( array ) ) ;
//
[
'b' ,
false ,
1 ,
0 ,
[ 'lolz' , [ 'a' , 4 ]
]
console . log ( compact ( 'non array' ) ) ; // []
执照
麻省理工学院
【文件预览】:
compact-array-master
----.gitattributes(52B)
----bower.json(442B)
----compact-array.js(1KB)
----test()
--------compact-array.js(694B)
----LICENSE.md(1KB)
----README.md(462B)
----.editorconfig(439B)
----.gitignore(1KB)
----CHANGELOG.md(82B)
----package.json(677B)