Standard built-ins
Iterator.from()
Obtains an iterator from an iterable or iterator, wrapping it when needed to supply the standard helper interface.
Formal Syntax & Structure
javascript syntaxjavascript
Iterator.from(source)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| source | Iterable | Iterator | Source sequence. |
Return Value
Iterator
Helper-capable iterator.
Working Example
Example Snippetjavascript
console.log(JSON.stringify(Iterator.from([1,2]).toArray()));