Replace the contents of array in-place with newContent and return it.
array
newContent
element type
target array to overwrite
new contents to set
the same array instance after replacement
Replace the contents of
arrayin-place withnewContentand return it.