Help with number animation

Its working for me: https://dudelemonweb.wixsite.com/holding-site/animated-number-test-ground

This is the code I used

let startNum = 2371292;
let endNum = 3000000;
const duration = 100;  

$w.onReady(function () {

});

function countUp(){ 
   if (startNum <= endNum ){
      $w('#text18').text = startNum.toString();
      startNum++;
   }
}


export function text18_viewportEnter(event, $w) {
   setInterval(()=> {
      countUp();  
   }, duration);
}

let startNum1 = 123;
let endNum1 = 789;
const duration1 = 100; 

$w.onReady(function () {

});

function countUp1(){ 
   if (startNum1 <= endNum1 ){
      $w('#text19').text = startNum1.toString();
      startNum1++;
   }
}

export function text19_viewportEnter(event, $w) {
	  setInterval(()=> {
      countUp1();  
   }, duration1);
}