function* fibs(n) { let a = 0; let b = 1; let i = 0; while (i < n) { yield a; [a, b] = [b, a + b]; i++; } } let [...move] = fibs(33); console.log(`<br>${move.join('<br>')}`);