1 var baseUnset = require('./_baseUnset');
4 * Removes the property at `path` of `object`.
6 * **Note:** This method mutates `object`.
11 * @param {Object} object The object to modify.
12 * @param {Array|string} path The path of the property to unset.
13 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
16 * var object = { 'a': [{ 'b': { 'c': 7 } }] };
17 * _.unset(object, 'a[0].b.c');
20 * console.log(object);
21 * // => { 'a': [{ 'b': {} }] };
23 * _.unset(object, 'a[0].b.c');
26 * console.log(object);
27 * // => { 'a': [{ 'b': {} }] };
29 function unset(object, path) {
30 return object == null ? true : baseUnset(object, path);
33 module.exports = unset;