Replaces the first array element matching the predicate with the given replacement. For your convenience the given replacement value is also passed to the predicate as a second parameter, so you can easily compare the two if needed.
the original element if replaced, undefined otherwise
Replaces the first array element matching the predicate with the given replacement. For your convenience the given replacement value is also passed to the predicate as a second parameter, so you can easily compare the two if needed.