Skip to content

Commit aab699f

Browse files
committed
Fix typo
1 parent 48082d6 commit aab699f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

data-structures-in-javascript/hash-table.es6.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class HashTable {
1818

1919
remove(key) {
2020
const hash = this.calculateHash(key);
21-
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
21+
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
2222
delete this.values[hash][key];
2323
this.numberOfValues--;
2424
}
@@ -30,7 +30,7 @@ class HashTable {
3030

3131
search(key) {
3232
const hash = this.calculateHash(key);
33-
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
33+
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
3434
return this.values[hash][key];
3535
} else {
3636
return null;

data-structures-in-javascript/hash-table.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ HashTable.prototype.add = function(key, value) {
1616
};
1717
HashTable.prototype.remove = function(key) {
1818
var hash = this.calculateHash(key);
19-
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
19+
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
2020
delete this.values[hash][key];
2121
this.numberOfValues--;
2222
}
@@ -26,7 +26,7 @@ HashTable.prototype.calculateHash = function(key) {
2626
};
2727
HashTable.prototype.search = function(key) {
2828
var hash = this.calculateHash(key);
29-
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
29+
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
3030
return this.values[hash][key];
3131
} else {
3232
return null;

0 commit comments

Comments
 (0)