JSFiddle - React, Tailwind, and code Playground
by kageurufu
HTML
<div id="log"></div>
JavaScript
function log(n) {$("#log").html($("#log").html()+"<br>"+n);}
function fib(n) {
var a = 0;
var b = 1;
var c = 0
for(i = 0; i <= n; i++) {
c = a;
a = a + b;
b = c;
log(a);
}
return a;
}
fib(20);