#js-set
####A simple, tested library implementing the set data structure in JavaScript
####Getting started is easy:
- Initializes an empty set. You can provide a custom hashFunction as an argument to the constructor--if no hashFunction is given, then it defaults to JSON.stringify.
- Gets the given value from the set if it exists. Else returns undefined.
- Variadic function that adds the given values to the set.
- Simple helper function which returns the set object
- Returns the amount of elements in the set
- Removes the given element from the set. Returns true if the element was removed, else returns false if the element didn't exist.
- Converts the set into an array of elements and returns the array
- Returns true if the set is empty (has no elements in it), else returns false.
- Returns true if the given element is the set, else returns false.
- Iterates over the elements in the set invoking the callback for each element. The callback function takes optional arguments value, index. The second argument of iterate defines the function context of the callback function when invoked.
- Iterates over the elements in the set using the given callback. If the callback returns a truthy value then the 'some' function immediately returns true, else it returns false. The callback function takes optional arguments value, index. The second argument of some defines the function context of the callback function when invoked.
- Modifies the current set to be the union of itself and the given set--'set2'. Returns this
modified set to make method chainable.
- Compares this set with set2 and returns the smaller set. If equal in size, returns set2.
- Returns a new set containing the intersection between this set and the set--'set2'
- Modifies current set to be the diffference between this set and the set--'set2'. Returns this modified set to make method chainable.
- Returns true if subset is a subset of this set, else returns false.
- Removes and returs a random element from the set.