From 3737ed3eab0c8173172890f544bf10158451d1de Mon Sep 17 00:00:00 2001 From: Cassidy Pignatello Date: Wed, 20 Dec 2017 14:00:39 -0500 Subject: [PATCH] fix: declares index variable in Set challenges --- .../coding-interview-data-structure-questions.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json b/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json index 8a7cf3d2c9..11525bd810 100644 --- a/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json +++ b/challenges/08-coding-interview-questions-and-take-home-assignments/coding-interview-data-structure-questions.json @@ -372,7 +372,7 @@ " // this method will remove an element from a set", " this.remove = function(element) {", " if(this.has(element)){", - " index = collection.indexOf(element);", + " var index = collection.indexOf(element);", " collection.splice(index,1);", " return true;", " }", @@ -424,7 +424,7 @@ " // this method will remove an element from a set", " this.remove = function(element) {", " if(this.has(element)){", - " index = collection.indexOf(element);", + " var index = collection.indexOf(element);", " collection.splice(index,1);", " return true;", " }", @@ -481,7 +481,7 @@ " // this method will remove an element from a set", " this.remove = function(element) {", " if(this.has(element)){", - " index = collection.indexOf(element);", + " var index = collection.indexOf(element);", " collection.splice(index,1);", " return true;", " }", @@ -550,7 +550,7 @@ " // this method will remove an element from a set", " this.remove = function(element) {", " if(this.has(element)){", - " index = collection.indexOf(element);", + " var index = collection.indexOf(element);", " collection.splice(index,1);", " return true;", " }", @@ -630,7 +630,7 @@ " // this method will remove an element from a set", " this.remove = function(element) {", " if(this.has(element)){", - " index = collection.indexOf(element);", + " var index = collection.indexOf(element);", " collection.splice(index,1);", " return true;", " }",