Skip to content

Instantly share code, notes, and snippets.

@nikensss
nikensss / index.ts
Last active December 8, 2021 17:09
Example of iterable iterators and async iterable iterators on TypeScript
/**
* A silly class wrapping a number to demonstrate any type of object can be used
* when using IterableIterators and how to use the 'n' value when iterating over
* them.
*/
class SpecialNumber {
private root: number;
constructor(root: number) {
this.root = root;