Skip to content

compute flatten

kgryte edited this page May 12, 2015 · 1 revision

Flattens an array.

var arr = [ 1, [2, [3, [4, [ 5 ], 6], 7], 8], 9 ];

var out = compute.flatten( arr );
// returns [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]

For method options, such as limiting depth, deep copying, and function generation, see compute-flatten.

Clone this wiki locally