unset

Delete the key and value at a given path.

This method chains an unset operation to the patch, which deletes a key and value at a specified path.

The difference between clear and unset is that clear clears the value preserving the path, while unset deletes the path.

Signature

This method has the following signature:

patch.unset(path: string): Patch

The return is the Patch instance itself to allow operation chaining.

Example

Here is a basic example of how to use this method:

patch.unset('preferences.color');

Parameters

The following list describes the supported parameters:

path
string

The path to the value to unset in dot notation, like address.city.