function ndims( x ) {
	var n = x.ndims; // Note: intentionally cache in case `ndims` is lazily resolved via accessor
	if ( typeof n === 'number' ) {
		return n;
	}
	return x.shape.length;
}
Returns the number of ndarray dimensions.

@param {ndarrayLike} x - input ndarray
@returns {NonNegativeInteger} number of dimensions

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

var n = ndims( zeros( [ 3, 3, 3 ] ) );
// returns 3