every 5 sec. Is there a way to limit this , so that it refreshes only 2 times ?
Why not just set two settimeout
let runs = 0; const interval = setInterval(() => { // ... runs++; if (runs >= 2) clearInterval(interval); }, 5000);
Обсуждают сегодня