function assign( x, index, value, out, stride, offset ) {
	var xo;
	var oo;

	index = normalizeIndex( index, x.length-1 );
	if ( index < 0 ) {
		throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%d`.', index ) );
	}
	xo = arraylike2object( x );
	oo = arraylike2object( out );
	if ( xo.accessorProtocol || oo.accessorProtocol ) {
		// Note: we only explicitly support a limited set of dtype-to-dtype pairs, as this function should not be concerned with casting rules, etc. That is left to userland...
		if (
			isComplexDataType( xo.dtype ) &&
			isComplexDataType( oo.dtype ) &&
			isComplexLike( value )
		) {
			complex( reinterpret( x, 0 ), index, value, reinterpret( out, 0 ), stride, offset ); // eslint-disable-line max-len
			return out;
		}
		if (
			isBooleanDataType( xo.dtype ) &&
			isBooleanDataType( oo.dtype )
		) {
			indexed( reinterpretBoolean( x, 0 ), index, Boolean( value ), reinterpretBoolean( out, 0 ), stride, offset ); // eslint-disable-line max-len
			return out;
		}
		accessors( xo, index, value, oo, stride, offset );
		return out;
	}
	indexed( x, index, value, out, stride, offset );
	return out;
}
Copies elements from one array to another array and sets the element at the specified index to a provided value.

@param {Collection} x - input array
@param {integer} index - element index
@param {*} value - replacement value
@param {Collection} out - output array
@param {integer} stride - output array stride
@param {NonNegativeInteger} offset - output array offset
@throws {RangeError} second argument must not exceed array bounds
@returns {Collection} output array

@example
var x = [ 1, 2, 3, 4 ];

var out = [ 0, 0, 0, 0 ];
var arr = assign( x, 0, 5, out, 1, 0 );
// returns [ 5, 2, 3, 4 ]

var bool = ( arr === out );
// returns true