function array_loop_alert_write()
Create an array.
Manually fill the array.
Loop through all array items.
Display each array item and the loop counter using both alert and document.write.
Carry On!
function array_loop_alert_write()
Create an array.
Manually fill the array.
Loop through all array items.
Display each array item and the loop counter using both alert and document.write.
Carry On!
function array_loop_alert_write(){
//Create an array; manually fill the array; loop through all array items; display each array item and the loop counter using alert and document.write
var array_object = new Array(); //Create an empty array object to hold a list of items.
array_object = ["zero","one","two",3,4]; //Fill array manually.
loop_end = array_object.length;
for(i=0;i<loop_end;i++){ //Loop through all items in the array
alert("i= "+i+" : array_object.length="+array_object.length+" : array_object["+i+"]= "+array_object[i]);
document.write("i= "+i+" : array_object.length="+array_object.length+" : array_object["+i+"]= "+array_object[i]+"<br />");
}
}