function ndarray2array( x ) {
	if ( !isndarrayLike( x ) ) {
		throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) );
	}
	return toArray( getData( x ), getShape( x ), getStrides( x ), getOffset( x ), getOrder( x ) ); // eslint-disable-line max-len
}
Converts an ndarray to a generic array (which may include nested arrays).

@param {ndarrayLike} x - input ndarray
@throws {TypeError} must provide an ndarray
@returns {(EmptyArray|Array|Array<Array>)} array (which may include nested arrays)

@example
var ndarray = require( '@stdlib/ndarray/ctor' );

var buffer = [ 1, 2, 3, 4 ];
var shape = [ 2, 2 ];
var order = 'row-major';
var strides = [ 2, 1 ];
var offset = 0;

var arr = ndarray( 'generic', buffer, shape, strides, offset, order  );

var out = ndarray2array( arr );
// returns [ [ 1, 2 ], [ 3, 4 ] ]