Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!