JSFiddle - React, Tailwind, and code Playground
CSS
div{
max-width:500px;
max-height:500px;
overflow: hidden;
background-color: aqua;
word-wrap: break-word;
}
JavaScript
(function() {
var pi = "3.141592653589793238462643383279502884197169399375105820974944592307816406286 208998628034825342117067982148086513282306647093844609550582231725359408128481";
var index = 5;
$('div').text(pi.substring(0, 5));
var timer = setInterval(function() {
$('div').append(pi[index]);
index++;
if (index === pi.length) {
clearInterval(timer);
}
});
})();