function* fib() {
    let a = 0, b = 1;
    while (true) {
        yield b;
        [a, b] = [b, a + b];  
    }
}

for (const i of fib()) {
    if (i > 55) break;
    console.log(i);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: