Lazy.js ES6 Generators Demo

In the <textarea> on the left, define an ES6 generator. In the middle, you can wrap this generator using Lazy(generator) and then map, filter, etc. to your heart's content. The resulting sequence will be evaluated and shown on the right.

This demo requires a very recent release of a modern browser, one which supports ECMAScript 6 "Harmony" features. One such browser that I'm aware of is the current beta release of Google Chrome. And even then you need to enable "Experimental JavaScript" at chrome://flags.

For more info on generators, see the MDN article.

Oh an by the way, in case you were wondering: this demo uses lemming.js to evaluate the code you enter in the editors below. (And the editors use CodeMirror.)

Back to the Lazy.js site