1var list = [{a:1,b:2}, {a:3,b:5}, {a:8,b:2}, {a:4,b:1}, {a:0,b:8}];
2
3for (var i = list.length - 1, item; item = list[i]; i--) {
4 console.log("Looping: index ", i, "item", item);
5}
6
7######### ES6 Update ################
8
9for (let item of list) {
10 console.log("Looping: index ", "Sorry!!!", "item" + item);
11}
1<html>
2 <body>
3 <script type = "text/javascript">
4 <!--
5 var count;
6 document.write("Starting Loop" + "<br />");
7
8 for(count = 0; count < 10; count++) {
9 document.write("Current Count : " + count );
10 document.write("<br />");
11 }
12 document.write("Loop stopped!");
13 //-->
14 </script>
15 <p>Set the variable to different value and then try...</p>
16 </body>
17</html>
1for (initialization; test condition; iteration statement) {
2 Statement(s) to be executed if test condition is true
3}
4