MyTetra Share
Делитесь знаниями!
for ... loop
Время создания: 13.05.2017 23:40
Раздел: javaScript - Statements
Запись: xintrea/mytetra_db_mcold/master/base/14947080577pvb0ywzi5/text.html на raw.githubusercontent.com

Example

Try the following example to learn how a for loop works in JavaScript.

<html>
   <body>
      
      <script type="text/javascript">
         <!--
            var count;
            document.write("Starting Loop" + "<br />");
         
            for(count = 0; count < 10; count++){
               document.write("Current Count : " + count );
               document.write("<br />");
            }
         
            document.write("Loop stopped!");
         //-->
      </script>
      
      <p>Set the variable to different value and then try...</p>
   </body>
</html>

Output

Starting Loop
Current Count : 0
Current Count : 1
Current Count : 2
Current Count : 3
Current Count : 4
Current Count : 5
Current Count : 6
Current Count : 7
Current Count : 8
Current Count : 9
Loop stopped! 
Так же в этом разделе:
 
MyTetra Share v.0.59
Яндекс индекс цитирования