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>
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.