JSFiddle - React, Tailwind, and code Playground

by dmykhailova

JavaScript

// Your code here.
function loop(n, test, update, body){
    while(!test(n)){
    	body(n);
    	update(n);
    }
}
loop(3, n => n > 0, n => n - 1, console.log);