Replaces the first array element matching the given value with the given replacement, or else adds it to the end of the array.
the original element if replaced, undefined if added
Replaces the first array element matching the given value with the given replacement, or else adds it to the end of the array.