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