0.0.2 • Published 11 years ago

flatten-list v0.0.2

Weekly downloads
14
License
-
Repository
github
Last release
11 years ago

flatten-list

Build Status Dependency Status

Flatten an array or array-like objects.

Reduces nested arrays or array-like objects (like arguments or NodeList in the browser) to a single array.

Example

var flatten = require('flatten-list');

flatten([1, [2, 3]]); // [1, 2, 3]
flatten([1, 2, 3]); // [1, 2, 3]
flatten(1); // [1]

function test() {
    return flatten(arguments);
}

test(1, [2, 3]); // [1, 2, 3];