While
O whileloop percorre a interação enquanto a condição for verdadeira.
while (condição) {
rotina
}Exemplo:
let passo = 1;
while (passo <= 3) {
console.log("Dei " + passo + " passos");
passo++
}
console.log("Chegamos!!!");
Last updated
Was this helpful?