let counter = 0; const container = document.getElementById("sec"); container && (function tic() { container.textContent = counter = ++counter % 60; setTimeout(tic, 1e3); })();