Connect with one of the following accounts


Please wait while we redirect...

Views: 187   

In javascript using forEach loop you can iterate on an array with index. You can check the following example where we are iterating on colors array with index.

var colors = ['red', 'green', 'blue'];

colors.forEach(function(v, i){
  console.log('Value at '+ i +' is: ' + v);


Value at 0 is: red
Value at 1 is: green
Value at 2 is: blue

On By

Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News