just-flatten-it
just-flatten-it是什么
什么是just-flatten-it,return a flattened array
just-flatten-it官网:官网
just-flatten-it源码仓库:源码仓库
just-flatt...
2018-12-02
什么是flatten,Flatten arbitrarily nested arrays into a non-nested list of non-array items
A tiny utility to flatten arrays of arrays (of arrays, etc., recursively, infinitely or to an optional depth) into a single array of non-arrays.
> var flatten = require('flatten');
undefined
> flatten([1, [2, 3], [4, 5, 6], [7, [8, 9]], 10])
[ 1,
2,
3,
4,
5,
6,
7,
8,
9,
10 ]
> flatten([1, [2, [3, [4, [5]]]]], 2)
[ 1,
2,
3,
[ 4, [ 5 ] ] ]
npm install flatten
MIT/X11.
本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。
转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]
本文地址:https://www.javascriptcn.com/read-42523.html
文章标题:flatten