Skip to content

Commit 208df80

Browse files
committed
renamed method from remove to delete
1 parent 205098a commit 208df80

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

chapter07/01-Dictionaries.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function Dictionary(){
66
items[key] = value; //{1}
77
};
88

9-
this.remove = function(key){
9+
this.delete = function(key){
1010
if (this.has(key)){
1111
delete items[key];
1212
return true;

chapter07/02-UsingDictionaries.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ console.log(dictionary.keys()); //outputs ["Gandalf", "John", "Tyrion"]
1111
console.log(dictionary.values()); //outputs ["gandalf@email.com", "johnsnow@email.com", "tyrion@email.com"]
1212
console.log(dictionary.get('Tyrion')); //outputs tyrion@email.com
1313

14-
dictionary.remove('John');
14+
dictionary.delete(John');
1515

1616
console.log(dictionary.keys()); //outputs ["Gandalf", "Tyrion"]
1717
console.log(dictionary.values()); //outputs ["gandalf@email.com", "tyrion@email.com"]

0 commit comments

Comments
 (0)