Skip to content

Commit

Permalink
clarify that from is static (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot committed Aug 2, 2023
1 parent 3e275cf commit 257f4ea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
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

0 comments on commit 257f4ea

Please sign in to comment.