Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
445 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | /**
|
---|
| 2 | * Removes `key` and its value from the hash.
|
---|
| 3 | *
|
---|
| 4 | * @private
|
---|
| 5 | * @name delete
|
---|
| 6 | * @memberOf Hash
|
---|
| 7 | * @param {Object} hash The hash to modify.
|
---|
| 8 | * @param {string} key The key of the value to remove.
|
---|
| 9 | * @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
---|
| 10 | */
|
---|
| 11 | function hashDelete(key) {
|
---|
| 12 | var result = this.has(key) && delete this.__data__[key];
|
---|
| 13 | this.size -= result ? 1 : 0;
|
---|
| 14 | return result;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | module.exports = hashDelete;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.