Code does not work on wix. Is there an error in this code?

let startNums = [3200000, 3200000]; 
let endNums = [3384000, 3384000]; 
const durations = [3, 3]; // 1000 milliseconds
const elements = ['#numberText', '#numberText2']; // Die Elemente, in denen hochgezählt wird 

$w.onReady(function () {   
for(let i = 0; i <= elements.length; i++){       
setInterval(() => {          
countUp(elements[i], i);       }, 
durations[i]);   
} 
});
functioncountUp(elementSelector, index) {    
if (startNum <= endNum) {     
$w(elementSelector).text = startNums[index].toLocaleString();     startNums[index] += 100;   
} 
}