Using for loop to get for specific iteration result in javascript - Javascript Statement

Javascript examples for Statement:for

Description

Using for loop to get for specific iteration result in javascript

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){// w w  w. j a  va2  s  .c o m
var array = 'abcdefghijklmnopqrstuvwxyz'.split('');

for (var i = 0; i < array.length;) {
    console.log(i, array[i]);
    i += 5;
}

    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials