Skip to content

Instantly share code, notes, and snippets.

// Source: https://www.section.io/engineering-education/hash-tables-in-javascript/#implementing-hash-tables-in-javascript%5D
class HashTable{
constructor(size=50){
this.buckets = new Array(size)
this.size = size
}
hash(key){
return key.toString().length % this.size;