Skip to content

Instantly share code, notes, and snippets.

@typeofweb
Created September 9, 2013 06:52
Show Gist options
  • Select an option

  • Save typeofweb/6492249 to your computer and use it in GitHub Desktop.

Select an option

Save typeofweb/6492249 to your computer and use it in GitHub Desktop.
import { iterator } from "std:iteration";
const iterable = {
*[iterator]() {
yield 1;
yield 2;
yield 3;
}
}
for (let x of iterable) {
console.log(x);
}
const lazySequence = (for (x of a) for (y of b) x * y);
for (let z of lazySequence) {
console.log(z);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment