Replaces an element of the array with the new element. The new element cannot already be a member of the array. The array is modified in-place.
name | type | description |
---|---|---|
array | array |
The array to search within. |
oldChild | * |
The element in the array that will be replaced. |
newChild | * |
The element to be inserted into the array at the position of |
Returns true if the oldChild was successfully replaced, otherwise returns false.