function fill( x, value ) {
	if ( !isndarrayLike( x ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
	}
	if ( isReadOnly( x ) ) {
		throw new Error( 'invalid argument. Cannot write to a read-only array.' );
	}
	base( x, value );
	return x;
}
Fills an input ndarray with a specified value.

@param {ndarray} x - input ndarray
@param {*} value - scalar value
@throws {TypeError} first argument must be an ndarray-like object
@throws {TypeError} second argument cannot be safely cast to the input ndarray data type
@throws {Error} cannot write to a read-only ndarray
@returns {ndarray} input ndarray

@example
var zeros = require( '@stdlib/ndarray/zeros' );
var getData = require( '@stdlib/ndarray/data-buffer' );

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

fill( x, 10.0 );

console.log( getData( x ) );
// => <Float64Array>[ 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 ]