Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

190
Visualizações
not output is being displayed loop is not working

no output is being displayed upon the execution of this code, i was wondering if it is the continue statement, it is meant to show even numbers only using the while loop

<html>
<head>
<title>while</title>
 </head>

<body>

hmm // no output  is being displayed 
<script>
var i = 1;
while (i <= 10)
{

if(i%2==1)
{
i+=l; continue;

}

document.write(i +"<br/>");
i+=l; 
}
</script>
</body>
</html>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You are using some incorrect character l instead of the number 1 in your script. This prevents it from properly incrementing.

<html>
<head>
<title>while</title>
 </head>

<body>

hmm // no output  is being displayed 
<script>
var i = 1;
while (i <= 10)
{

if(i%2==1)
{
i+=1; continue;

}

document.write(i +"<br/>");
i+=1; 
}
</script>
</body>
</html>

The two instances of l were replaced with 1, in the code snippet you can see it now prints your even values. The code also appears to work with or without the continue; statement.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda