JSFiddle - React, Tailwind, and code Playground

by Rodney Golpe

JavaScript

function y(iterations) {
	let currentVal = 0;
	let nextVal = 1;
	let counter = 0;
	while (iterations--) {
    	let tempVal = nextVal;
		nextVal = nextVal + currentVal;
        currentVal = tempVal;
        counter++;
        console.info(`${counter} == ${nextVal}`);
	}
}

y(50);