4.17.11
3.10.1
2.4.2
1.3.1
_.unset(object, path)
Removes the property at path of object.
Note: This method mutates object.
Since
4.0.0
Arguments
argument
objectpathtype
Object
(Array|string)
description
The object to modify.
The path of the property to unset.
Returns
(array)Example
var object = { a: [{ b: { c: 7 } }] };
_.unset(object, "a[0].b.c");
// => true
console.log(object);
// => { 'a': [{ 'b': {} }] };
_.unset(object, ["a", "0", "b", "c"]);
// => true
console.log(object);
// => { 'a': [{ 'b': {} }] };
var object = { a: [{ b: { c: 7 } }] };
_.unset(object, "a[0].b.c");
// => true
console.log(object);
// => { 'a': [{ 'b': {} }] };
_.unset(object, ["a", "0", "b", "c"]);
// => true
console.log(object);
// => { 'a': [{ 'b': {} }] };