Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

clarify that from is static #282

Merged
merged 1 commit into from
Aug 2, 2023
Merged
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
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,9 @@ function* naturals() {
naturals().find(v => v > 1); // 2
```

### `.from(object)`
### `Iterator.from(object)`

`.from` takes an object as an argument. This method allows wrapping "iterator-like" objects with an
iterator.
`.from` is a _static_ method (unlike the others listed above) which takes an object as an argument. This method allows wrapping "iterator-like" objects with an iterator.

Returns the object if it is already an iterator, returns a wrapping iterator if the passed object
implements a callable @@iterator property.
Expand Down
Loading