im learning can someone explain me why this are happen in my code, many thanks in advance

setInterval(function(){
    let mostra = document.getElementById("mostrar");
    let contagem = ["5","4","3","2","1","..."];
    let ic = 0;
    let conta = contagem[ic];
    while(conta <= contagem.length){
        
        mostra.textContent = `algum texto  ${conta++}`;
    }
}, 1000);

and this not works and i try …

setInterval(function(){
    let mostra = document.getElementById("mostrar");
    let contagem = ["5","4","3","2","1","..."];
    for(let ic = 0; ic <= contagem.length; ic++){
        let conta = contagem[ic];
        mostra.textContent = `algum texto  ${conta++}`;
    }
}, 1000);

both failed im trying to redirect a user to home page and do 5, 4, 3, 2, 1, … and homepage

many thanks

someone to help me and explain what im doing wrong