@myinan/hash-set

1.0.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @myinan/hash-set

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

3.4 kB

Total Files

3

Last publish

Collaborators

  • myinan