Commit 4f4c423b authored by Chris's avatar Chris

Updating README

parent 50ff3935
......@@ -2,6 +2,8 @@
[![Build Status][2]][3]
---
A basic implementation of the `Set` data structure in Javascript. In case you don't know what a `Set` is, I'll quote [Wikipedia][1]...
> A set is an abstract data structure that can store certain values, without any particular order, and no repeated values.
......@@ -21,38 +23,38 @@ var set = new BasicSet(1,'2',[2.5,'c'],'d',5.0); // {1,'2',2.5,'c','d',5.0}
### Methods
**add(args)**
<br>Appends all elements in `args` to the `BasicSet` object. `args` can be a value, several values, an array of values, or a mix of values and arrays of values. Returns the `BasicSet` object.
**add(args)**
Appends all elements in `args` to the `BasicSet` object. `args` can be a value, several values, an array of values, or a mix of values and arrays of values. Returns the `BasicSet` object.
**remove(args)**
<br>Removes all elements in `args` from the `BasicSet` object. `args` can be a value, several values, an array of values, or a mix of values and arrays of values. Returns the `BasicSet` object.
**remove(args)**
Removes all elements in `args` from the `BasicSet` object. `args` can be a value, several values, an array of values, or a mix of values and arrays of values. Returns the `BasicSet` object.
**has(value)**
<br>Returns a boolean asserting whether an element is present with the given value in the `BasicSet` object or not.
**has(value)**
Returns a boolean asserting whether an element is present with the given value in the `BasicSet` object or not.
**hasSome(args)**
<br>Returns a boolean asserting whether any of the elements in `args` are present in the `BasicSet` object. `args` can be a value, several values, an array of values, or a mix of values and arrays of values.
**hasSome(args)**
Returns a boolean asserting whether any of the elements in `args` are present in the `BasicSet` object. `args` can be a value, several values, an array of values, or a mix of values and arrays of values.
**hasAll(args)**
<br>Returns a boolean asserting whether all of the elements in `args` are present in the `BasicSet` object. `args` can be a value, several values, an array of values, or a mix of values and arrays of values.
**hasAll(args)**
Returns a boolean asserting whether all of the elements in `args` are present in the `BasicSet` object. `args` can be a value, several values, an array of values, or a mix of values and arrays of values.
**getAll()**
<br>Returns an `Array` containing every element in the `BasicSet` object.
**getAll()**
Returns an `Array` containing every element in the `BasicSet` object.
**getIntersection(valuesArray)**
<br>Returns an `Array` containing every element from `valuesArray` that is present in the `BasicSet` object. `valuesArray` must be an array of values.
**getIntersection(valuesArray)**
Returns an `Array` containing every element from `valuesArray` that is present in the `BasicSet` object. `valuesArray` must be an array of values.
**size()**
<br>Returns the number of elements in the `BasicSet` object.
**size()**
Returns the number of elements in the `BasicSet` object.
**isEmpty()**
<br>Returns a boolean asserting whether the `BasicSet` object contains no elements.
**isEmpty()**
Returns a boolean asserting whether the `BasicSet` object contains no elements.
**clear()**
<br>Removes all elements from the `BasicSet` object. Returns the `BasicSet` object.
**clear()**
Removes all elements from the `BasicSet` object. Returns the `BasicSet` object.
**toString()**
<br>Returns a String representation of the elements in the `BasicSet` object.
**toString()**
Returns a String representation of the elements in the `BasicSet` object.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment