function emptyLike( x ) {
	var options;
	var dtype;
	var order;
	var ndims;
	var opts;
	var buf;
	var len;
	var st;
	var sh;

	if ( !isndarrayLike( x ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
	}
	opts = {};
	if ( arguments.length > 1 ) {
		options = arguments[ 1 ];
		if ( !isPlainObject( options ) ) {
			throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
		}
		if ( hasOwnProp( options, 'dtype' ) ) {
			dtype = options.dtype;
		} else {
			dtype = getDType( x );
		}
		if ( hasOwnProp( options, 'shape' ) ) {
			sh = options.shape;
			if ( isNumber( sh ) ) {
				sh = [ sh ];
			}
			if ( !isNonNegativeIntegerArray( sh ) && !isEmptyCollection( sh ) ) { // eslint-disable-line max-len
				throw new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer or an array of nonnegative integers. Option: `%s`.', 'shape', sh ) );
			}
		} else {
			sh = getShape( x );
		}
		if ( hasOwnProp( options, 'order' ) ) {
			order = options.order;
		} else {
			order = getOrder( x );
		}
		if ( hasOwnProp( options, 'mode' ) ) {
			opts.mode = options.mode;
		}
		if ( hasOwnProp( options, 'submode' ) ) {
			opts.submode = options.submode;
		}
	} else {
		dtype = getDType( x );
		sh = getShape( x );
		order = getOrder( x );
	}
	ndims = sh.length;
	if ( ndims > 0 ) {
		len = numel( sh );
		st = shape2strides( sh, order );
	} else {
		// For 0-dimensional arrays, the buffer should contain a single element...
		len = 1;
		st = [ 0 ];
	}
	if ( dtype === 'binary' ) {
		buf = allocUnsafe( len );
	} else {
		buf = emptyArray( len, dtype );
	}
	return new ndarray( dtype, buf, sh, st, strides2offset( sh, st ), order, opts ); // eslint-disable-line max-len
}
Creates an uninitialized ndarray having the same shape and data type as a provided ndarray.

@param {ndarray} x - input array
@param {Options} [options] - function options
@param {string} [options.dtype] - output array data type (overrides the input array's inferred data type)
@param {string} [options.order] - specifies whether the output array should be 'row-major' (C-style) or 'column-major' (Fortran-style) (overrides the input array's inferred order)
@param {(NonNegativeIntegerArray|NonNegativeInteger)} [options.shape] - output array shape (overrides the input array's inferred shape)
@param {string} [options.mode="throw"] - specifies how to handle indices which exceed array dimensions
@param {StringArray} [options.submode=["throw"]] - specifies how to handle subscripts which exceed array dimensions on a per dimension basis
@throws {TypeError} first argument must have a recognized data type
@throws {TypeError} options argument must be an object
@throws {TypeError} `dtype` option must be a supported ndarray data type
@throws {TypeError} `order` option must be a supported order
@throws {TypeError} `shape` option must be either a nonnegative integer or an array of nonnegative integers
@throws {TypeError} must provide valid options
@returns {ndarray} ndarray

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

var x = zeros( [ 2, 2 ] );
// returns <ndarray>

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

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

var dt = y.dtype;
// returns 'float64'