Sunday, June 10, 2018

JavaScript - Control Structures - Looping through Array

Below example demonstrates usage of looping through array in JavaScript:

var myArr = ["Sunday","Monday","Tuesday"
             ,"Wednesday","Thursday"
             ,"Friday","Saturday"];

//console.log(myArr.length);

for (i=0;i<myArr.length;i++){
  console.log(myArr[i])
}


Try it out at: http://jsbin.com

No comments:

Post a Comment