function fill( x, value, start, end ) {
	var obj;
	if ( hasMethod( x, 'fill' ) ) {
		return x.fill( value, start, end );
	}
	if ( start < 0 ) {
		start += x.length;
		if ( start < 0 ) {
			start = 0;
		}
	}
	if ( end < 0 ) {
		end += x.length; // if `end` is still negative, that is fine, as `x` will be returned un-mutated
	} else if ( end > x.length ) {
		end = x.length;
	}
	obj = arraylike2object( x );
	if ( obj.accessorProtocol ) {
		return accessors( obj, value, start, end );
	}
	return indexed( x, value, start, end );
}
Fills all elements within a portion of an array with a specified value.

@param {Collection} x - input array
@param {*} value - fill value
@param {integer} start - starting index (inclusive)
@param {integer} end - ending index (exclusive)
@returns {Collection} output array

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

var out = fill( x, 5, 1, 3 );
// returns [ 1, 5, 5, 4 ]

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

@example
var Int32Array = require( '@stdlib/array/int32' );

var x = new Int32Array( [ 1, 2, 3, 4 ] );

var out = fill( x, 5, 1, 3 );
// returns <Int32Array>[ 1, 5, 5, 4 ]

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