for loop through an array with javascript

looping through an array with javascript using a basic for loop

Javascript

var my_array = [1,2,3,4,5,6,7,8];
var i;
var text;
for (i = 0; i < my_array.length; i++) { 
  text += my_array[i] + "<br>";
}
console.log(text);

Demo

Other Items in javascript

Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

❤👩‍💻🕹