diff --git a/data-structures/set.js b/data-structures/set.js index a147b5e..fe5189d 100644 --- a/data-structures/set.js +++ b/data-structures/set.js @@ -70,7 +70,7 @@ Set.prototype.add = function(value) { // O(1) Set.prototype.delete = function(value) { - if (this._storage[value]) { + if (this.has(value)) { delete this._storage[value]; this._count--; return true;