function dtype( x ) {
	var dt;

	// Note: we intentionally avoid rigorous ndarray checks to minimize performance impacts. This obviously means that non-ndarray-like objects can sneak through, but this is likely all right for the purposes of this function...
	if ( typeof x !== 'object' || x === null ) {
		throw new TypeError( format( 'invalid argument. Must provide an ndarray. Value: `%s`.', x ) );
	}
	dt = x.dtype;
	if ( isDataType( dt ) ) {
		return dt;
	}
	// A data type is essential for interpreting the memory associated with an ndarray object, so no fallbacks or workarounds for data type resolution...
	throw new TypeError( format( 'invalid argument. Must provide an ndarray having a supported data type. Value: `%s`.', dt ) );
}
Returns the data type of a provided ndarray.

@param {ndarrayLike} x - input ndarray
@throws {TypeError} must provide an ndarray having a supported data type
@returns {string} data type

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

var x = zeros( [ 3, 3, 3 ], {
    'dtype': 'float64'
});

var dt = dtype( x );
// returns 'float64'