MCPcopy Index your code
hub / github.com/trekhleb/javascript-algorithms / get

Method get

src/data-structures/hash-table/HashTable.js:87–92  ·  view source on GitHub ↗

* @param {string} key * @return {*}

(key)

Source from the content-addressed store, hash-verified

85 * @return {*}
86 */
87 get(key) {
88 const bucketLinkedList = this.buckets[this.hash(key)];
89 const node = bucketLinkedList.find({ callback: (nodeValue) => nodeValue.key === key });
90
91 return node ? node.value.value : undefined;
92 }
93
94 /**
95 * @param {string} key

Callers 1

HashTable.test.jsFile · 0.45

Calls 2

hashMethod · 0.95
findMethod · 0.45

Tested by

no test coverage detected