JSFiddle - React, Tailwind, and code Playground

HTML

<div>2</div>

JavaScript

$(function() {
    setInterval(function() {
           var container = $('div'),
               number = parseInt(container.text());
        
        container.text(number + Math.floor(2 + 2));
    }, 1000);
});