steamroller_test_likeflat_nodejs
v1.0.1
Published
数组的扁平化处理
Downloads
4
Readme
描述: 对嵌套的数组进行扁平化处理。你必须考虑到不同层级的嵌套。 如:utils.steamroller([1, [2], [3, [[4]]]]) 应该返回 [1, 2, 3, 4]。 utils.steamroller([1, [], [3, [[4]]]]) 应该返回 [1, 3, 4]。 utils.steamroller([1, {}, [3, [[4]]]]) 应该返回 [1, {}, 3, 4]。