function toReversed( x ) {
	var out;
	var xr;

	// Create a reversed view of the input ndarray:
	xr = reverse( x, false );

	// Create an output ndarray with the same shape and data type as the input ndarray:
	out = emptyLike( x );

	// Assign the elements of the reversed input ndarray view to the output ndarray:
	assign( [ xr, out ] );

	return out;
}
Returns a new ndarray where the order of elements of an input ndarray is reversed along each dimension.

@param {ndarray} x - input array
@returns {ndarray} output array

@example
var ndarray = require( '@stdlib/ndarray/ctor' );
var ndarray2array = require( '@stdlib/ndarray/to-array' );

var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
var shape = [ 3, 2 ];
var strides = [ 2, 1 ];
var offset = 0;

var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
// returns <ndarray>

var sh = x.shape;
// returns [ 3, 2 ]

var arr = ndarray2array( x );
// returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]

var y = toReversed( x );
// returns <ndarray>

sh = y.shape;
// returns [ 3, 2 ]

arr = ndarray2array( y );
// returns [ [ 6.0, 5.0 ], [ 4.0, 3.0 ], [ 2.0, 1.0 ] ]