1.0.0 • Published 2 years ago

@myinan/hash-set v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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.

1.0.0

2 years ago