## replace() function  
The "replace" operation replaces the value at the target location with a new value. The operation object MUST contain a "value" member whose content specifies the replacement value. The target location MUST exist for the operation to be successful.  
This operation is functionally identical to a "remove" operation for a value, followed immediately by an "add" operation at the same location with the replacement value.  
Even more simply, it's like the add operation with an existence check.

**Signature:**  
```typescript  
export declare function replace(object: any, operation: ReplaceOperation, _options?: PatchOptions): MissingError | null;  
```

## Parameters  
| Parameter | Type | Description |  
| --- | --- | --- |  
| object | any | The object being patched. |  
| operation | [ReplaceOperation](/content/docs/sdk/core.replaceoperation) | The operation to perform on the object. |  
| _options | [PatchOptions](/content/docs/sdk/core.patchoptions) | _(Optional)_ Optional params. |

**Returns:**  
[MissingError](/content/docs/sdk/core.missingerror) | null  
null on success, or error if one occurred.
