From d51e1ce42bd5fe7f1448224d2a517dc24f68f862 Mon Sep 17 00:00:00 2001 From: Kellan Alexander Date: Sun, 6 Aug 2017 13:41:04 -0700 Subject: [PATCH] Update set.js make use of 'has' method --- data-structures/set.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;