diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 9119e12..ea0f9b1 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -10,6 +10,7 @@ - [equals](equals.md) - [filter](filter.md) - [forEach](foreach.md) +- [for...of](forof.md) - [has](has.md) - [intersection](intersection.md) - [isDisjointWith](isdisjointwith.md) diff --git a/docs/add.md b/docs/add.md index ba8a6fe..a1f5c5c 100644 --- a/docs/add.md +++ b/docs/add.md @@ -4,11 +4,11 @@ Adds an element to the existing set. Returns the current set (with the new element). -`add(val: T): AdvancedSet` +`add(...vals: T[]): AdvancedSet` ### Parameters -`val` - The element to add to the set. +`vals` - Any elements to be added to the set. ### Usage @@ -18,10 +18,12 @@ setA.add(0); // AdvancedSet(1, 2, 3, 4, 5, 0) // Original object is changed, as well as the return value console.log(setA); // AdvancedSet(1, 2, 3, 4, 5, 0) + +setA.add(6, 7, 8); ``` ### Details Introduced in: 0.0.1 -Last updated in: 0.0.1 +Last updated in: 0.0.3 diff --git a/docs/equals.md b/docs/equals.md index 7ce7f19..9bf3055 100644 --- a/docs/equals.md +++ b/docs/equals.md @@ -27,4 +27,4 @@ setA.equals(setC); // false Introduced in: 0.0.1 -Last updated in: 0.0.1 +Last updated in: 0.0.3 diff --git a/docs/forof.md b/docs/forof.md new file mode 100644 index 0000000..acc8d79 --- /dev/null +++ b/docs/forof.md @@ -0,0 +1,24 @@ +# for...of() + +### Overview + +`AdvancedSet`'s have iterator support, which allows them to be used in `for...of` loops + +### Parameters + +None + +### Usage + +```js +const setA = new AdvancedSet(1, 2, 3, 4, 5, 6); +for (const val of setA) { + console.log(val); +} +``` + +### Details + +Introduced in: 0.0.3 + +Last updated in: 0.0.3 diff --git a/docs/intersection.md b/docs/intersection.md index dc85c40..f222323 100644 --- a/docs/intersection.md +++ b/docs/intersection.md @@ -27,4 +27,4 @@ setA.intersection(setC); // AdvancedSet() Introduced in: 0.0.1 -Last updated in: 0.0.1 +Last updated in: 0.0.3