Change loop counter in for loop body - Javascript Statement

Javascript examples for Statement:for

Description

Change loop counter in for loop body

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(){/*ww w .  j  a  v a  2 s .  c  om*/
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