examples/flatten.js
function flatten(list) {
    return list.reduce(function (acc, item) {
        if (Array.isArray(item)) {
            return acc.concat(flatten(item));
        }
        else {
            return acc.concat(item);
        }
    }, []);
}
function flatten(list) {
    return list.reduce(function (acc, item) {
        if (Array.isArray(item)) {
            return acc.concat(flatten(item));
        }
        else {
            return acc.concat(item);
        }
    }, []);
}
function flatten ( list ) { return list . reduce ( function ( acc , item ) { if ( Array . isArray ( item ) ) { return acc . concat ( flatten ( item ) ) ; } else { return acc . concat ( item ) ; } } , [ ] ) ; }
export utility to flatten nested arrays
export utility to flatten nested arrays