80Part IIJavaScript Tutorialis found. When the (Fedora web server) forloop breaks,
80Part IIJavaScript Tutorialis found. When the forloop breaks, the value of the icounter is fixed at the row of theUSStatesarray containing the entered state. I need that index value to find the correspond- ing entry in the other array. Even though the counting variable, i, is initialized in the forloop, it is still alive and in the scope of the function for all statements after the initialization. That s why I can use it to extract the value of the row of the stateEnteredarray in the finalstatement that displays the results in an alert message. This application of a forloop and array indexes is a common one in JavaScript. Study thecode carefully and be sure you understand how it works. This way of cycling through arraysplays a role not only in the kinds of arrays you create in your code, but also with the arraysthat browsers generate for the document object model. Document objects in arraysIf you look at the documentobject portions of the Quick Reference in Appendix A, you cansee that the properties of some objects are listed with square brackets after them. These are, indeed, the same kind of square brackets you just saw for array indexes. That s because whena document loads, the browser creates arrays of like objects in the document. For example, ifyour page includes two