programming-examples/js/Others/A Demonstration of a Nested Loop.js

21 lines
585 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
<html>
<head>
<title>A Demonstration of a Nested Loop - Happy Codings :-) JavaScript Code Examples</title>
</head><body>
<script type="text/javascript">
<!--
document.write("All x,y coordinates between (0,0) and (9,9):<br>")
for (var x = 0; x < 10; ++x) {
for (var y = 0; y < 10; ++y) {
document.write("(" + x + "," + y + "),");
}
document.write('<br>');
}
document.write("<br>After completing the loop, x equals : " + x);
document.write("<br>After completing the loop, y equals : " + y);
// -->
</script>
</body>
</html>