Returns a new array with the element at the specified index replaced with the new given element.
index
element
The array to replace the element within.
The index of the element to replace.
The element to replace the original with.
Returns a new array with the element at the specified
indexreplaced with the new givenelement.