Within script tags in the body of my HTML, I have:
aRay = new Array();
aRay[0] = 'a';
aRay[1] = 'b';
aRay[2] = 'c';
aRay[3] = 'd';
aRay[4] = 'e';
document.write("aRay length is "+aRay.length+"</br>");
for( i = 0; i < aRay.length; i++ )
document.write("element "+i+" is "+aRay[i]+"</br>");
for( y = 0; y < aRay.length; y++ ) {
if(aRay[y]='d')
document.write("so we can find ""+aRay[y]+"" in element "+y+"</br>");
break;
endif;
}
And what prints out is:
aRay length is 5 element 0 is a element 1 is b element 2 is c element 3 is d element 4 is e so we can find "