Skip to content

Instantly share code, notes, and snippets.

@wavded wavded/gen.js
Created Apr 23, 2014

What would you like to do?
TCO in Generators
function* fibGen (current, next) {
yield current
yield* fibGen(next, current + next)
for (var num of fibGen(0,1));
// function* fibGen (current, next) {
// ^
// RangeError: Maximum call stack size exceeded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.