The unset
function from lodash is used to remove the property at the specified path of an object. Here's an example of how to use it:
index.tsx295 chars17 lines
In this example, we have an object myObj
with a nested address
object. We use the unset
function to remove the zip
property from the address
object.
Note that the unset
function mutates the original object, so use it with caution.
gistlibby LogSnag