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
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