Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc Updates 0.0.3 #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions docs/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

Adds an element to the existing set. Returns the current set (with the new element).

`add(val: T): AdvancedSet<T>`
`add(...vals: T[]): AdvancedSet<T>`

### Parameters

`val` - The element to add to the set.
`vals` - Any elements to be added to the set.

### Usage

Expand All @@ -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
2 changes: 1 addition & 1 deletion docs/equals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 24 additions & 0 deletions docs/forof.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/intersection.md
Original file line number Diff line number Diff line change
Expand Up @@ -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