@myinan/hash-set
v1.0.0
Published
My custom made linked hash-set module.
Downloads
2
Readme
A hashSet implementation with JS which stores only keys and no values.
set
takes single argument, key, and adds the key to the HashSet.
has
takes a key as an argument and returns true or false based on whether or not the key is in the hash map.
remove
takes a key as an argument. If the given key is in the hash map, it should remove the key and return true. If the key isn’t in the hash map, it should return false.
length
returns the number of stored keys in the hash map.
clear
removes all keys in the hash map.
keys
returns an array containing all the keys inside the hash map.