JSFiddle - React, Tailwind, and code Playground

HTML

<div id="out"></div>

JavaScript

/* generates 'count' fibonacci number pairs */
function* fib(count) {
   let a = 1;
   let b = 1;
   for (var i = count; i--;) {
     yield a;
     yield b;
     a = a+b;
     b = a+b;
   }
}

let out = document.getElementById("out");
let outStr = "";

let it = fib(5);
for (let value of it) {
  console.log(value);
  outStr += `${value} <br>`;
}
out.innerHTML = outStr;