JavaScript Programming
JavaScript > Code Examples
A While Loop That Decrements from 10 to 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
A While Loop That Decrements from 10 to 1
<html>
<head>
<title>Happy Codings :-) JavaScript Code Examples</title>
</head>
<body>
<H1>
<SCRIPT>
var counter = 10;
while (counter > 0)
{
document.write (counter + "<br>");
counter--;
}
</SCRIPT>
</H1>
</body>
</html>