Replaces the elements from startIndex to (but not including) endIndex with replacement.
Returns a shallow copy without replacement if startIndex >= endIndex or if one or both indices
is not an integer.
Negative indices count backwards from the end of the array.
Replaces the elements from
startIndex
to (but not including)endIndex
withreplacement
. Returns a shallow copy without replacement ifstartIndex >= endIndex
or if one or both indices is not an integer.Negative indices count backwards from the end of the array.
Example