function assign( condition, x, y, out, stride, offset ) {
	var co;
	var xo;
	var yo;
	var oo;
	var N;

	// Check whether we can avoid doing any work...
	if ( condition.length === 0 ) {
		return out;
	}
	// Compute the number of indexed elements in the output array:
	N = numel( out.length, stride, offset );

	co = arraylike2object( condition );
	if ( isBooleanDataType( co.dtype ) ) {
		condition = reinterpretBool( condition, 0 );
		co = arraylike2object( condition );
	}
	xo = arraylike2object( x );
	yo = arraylike2object( y );
	oo = arraylike2object( out );
	if (
		co.accessorProtocol ||
		xo.accessorProtocol ||
		yo.accessorProtocol ||
		oo.accessorProtocol
	) {
		// Note: we only explicitly special case a select number of same dtype-to-dtype combinations, as this function should not be concerned with casting rules, etc. That is left to userland...
		if (
			co.accessorProtocol === false &&
			isBooleanDataType( xo.dtype ) &&
			isBooleanDataType( yo.dtype ) &&
			isBooleanDataType( oo.dtype )
		) {
			indexed( N, condition, reinterpretBool( x, 0 ), reinterpretBool( y, 0 ), reinterpretBool( out, 0 ), stride, offset ); // eslint-disable-line max-len
			return out;
		}
		if (
			isComplexDataType( xo.dtype ) &&
			isComplexDataType( yo.dtype ) &&
			isComplexDataType( oo.dtype )
		) {
			complex( N, co, reinterpretCmplx( x, 0 ), reinterpretCmplx( y, 0 ), reinterpretCmplx( out, 0 ), stride, offset ); // eslint-disable-line max-len
			return out;
		}
		accessors( N, co, xo, yo, oo, stride, offset );
		return out;
	}
	indexed( N, condition, x, y, out, stride, offset );
	return out;
}
Takes elements from either one of two arrays depending on a condition and assigns the values to elements in a provided output array.

@param {Collection} condition - indicator array
@param {Collection} x - first input array
@param {Collection} y - second input array
@param {Collection} out - output array
@param {integer} stride - output array stride
@param {NonNegativeInteger} offset - output array offset
@throws {Error} input arrays must be broadcast compatible with the output array
@returns {Collection} output array

@example
var x = [ 1, 2, 3, 4 ];
var y = [ 5, 6, 7, 8 ];

var out = [ 0, 0, 0, 0 ];
var condition = [ true, false, true, false ];

var arr = assign( condition, x, y, out, 1, 0 );
// returns [ 1, 6, 3, 8 ]

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