function stride( x, dim ) {
	var N;
	var d;

	// Retrieve array meta data:
	N = ndims( x );

	// Check whether we were provided a zero-dimensional array...
	if ( N === 0 ) {
		throw new TypeError( format( 'invalid argument. First argument must be an ndarray having one or more dimensions. Number of dimensions: %d.', N ) );
	}
	// Normalize the dimension index:
	d = normalizeIndex( dim, N-1 );
	if ( d === -1 ) {
		throw new RangeError( format( 'invalid argument. Dimension index exceeds the number of dimensions. Number of dimensions: %d. Value: `%d`.', N, dim ) );
	}
	// Return the array stride:
	return getStrides( x, false )[ d ];
}
Returns the stride along a specified dimension for a provided ndarray.

@param {ndarrayLike} x - input ndarray
@param {integer} dim - dimension index
@throws {TypeError} first argument must be an ndarray having one or more dimensions
@throws {RangeError} dimension index exceeds the number of dimensions
@returns {integer} stride

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

var out = stride( zeros( [ 3, 3, 3 ] ), 0 );
// returns 9