function arrayWith( x, index, value ) {
	var out;
	var set;
	if ( hasMethod( x, 'with' ) ) {
		return x.with( index, value );
	}
	index = normalizeIndex( index, x.length-1 );
	if ( index < 0 ) {
		throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%d`.', index ) );
	}
	out = slice( x, 0, x.length );
	set = resolveSetter( out );
	set( out, index, value );
	return out;
}
Returns a new array with the element at the specified index replaced with a provided value.

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

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

var v = arrayWith( x, 0, 5 );
// returns [ 5, 2, 3, 4 ]

v = arrayWith( x, 1, 6 );
// returns [ 1, 6, 3, 4 ]

v = arrayWith( x, -2, 7 );
// returns  [ 1, 2, 7, 4 ]