function flag( x, name ) {
	// 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. First argument must be an ndarray. Value: `%s`.', x ) );
	}
	if ( !isPropertyKey( name ) ) {
		throw new TypeError( format( 'invalid argument. Second argument must be a valid property name. Value: `%s`.', name ) );
	}
	return flags( x, false )[ name ];
}
Returns a specified flag for a provided ndarray.

@param {ndarrayLike} x - input ndarray
@param {(string|symbol)} name - flag name
@throws {TypeError} first argument must be an ndarray having one or more dimensions
@throws {TypeError} second argument must be a valid property name
@returns {*} flag value

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

var out = flag( zeros( [ 3, 3, 3 ] ), 'READONLY' );
// returns <boolean>