Last active
January 14, 2018 01:23
-
-
Save MichaelSitter/86784deaaa225e64bfe4fb6f49c987db to your computer and use it in GitHub Desktop.
JS data structures - Hash Table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function HashTable() { | |
var table = {}; | |
this.set = function (key, value) { | |
table[key] = value; | |
}; | |
this.get = function (key) { | |
return table[key]; | |
}; | |
this.clear = function () { | |
table = {}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment