JSFiddle - React, Tailwind, and code Playground

JavaScript

function getRandomInRange(a) {
    return Math.floor(Math.random() * a);
};


function print(x) {
    document.body.innerHTML += "<p>" + x + "</p>";
};

setInterval(function() {
    print(getRandomInRange(20));
}, 2000);