make an interface iterator typescript 1

make an interface iterator typescript

interface Iterable {
    [Symbol.iterator](): Iterator;
}

Here is what the above code is Doing:
1. The Iterator interface is defined as a function that returns an IteratorResult.
2. The IteratorResult interface is defined as an object with two properties: value and done.
3. The Iterable interface is defined as an object with a method that returns an Iterator.

Similar Posts