dist/utilify.esm.js
function arrayFlatten(arr, level) {
        var self = this;
        var result = [];
        var current = 0;
        level = level || Infinity;

        self._forEach(arr, function (el) {
            if (validateHelpers.isArray(el) && current < level) {
                result = result.concat(self.arrayFlatten(el, level, current + 1));
            } else {
                result.push(el);
            }
        });
        return result;
    }
function arrayFlatten(arr, level) {
        var self = this;
        var result = [];
        var current = 0;
        level = level || Infinity;

        self._forEach(arr, function (el) {
            if (validateHelpers.isArray(el) && current < level) {
                result = result.concat(self.arrayFlatten(el, level, current + 1));
            } else {
                result.push(el);
            }
        });
        return result;
    }
function arrayFlatten ( arr , level ) { var self = this ; var result = [ ] ; var current = 0 ; level = level || Infinity ; self . _forEach ( arr , function ( el ) { if ( validateHelpers . isArray ( el ) && current < level ) { result = result . concat ( self . arrayFlatten ( el , level , current + 1 ) ) ; } else { result . push ( el ) ; } } ) ; return result ; }
Returns a flattened, one-dimensional copy of the array.
You can optionally specify a limit, which will only flatten to that depth.

@param  {Array}   arr              Array to flatten
@param  {Integer} level[Infinity]  Depth
@return {Array}
Returns a flattened one - dimensional copy of the array . You can optionally specify a limit which will only flatten to that depth .