for(var x=0; x<names.length; x++)
{...loop body...}
The loop body can do any number of things, such as:
Output the information: document.write(names[x]);
Assign information: names[x] = window.prompt("Enter a name");
Search for a value: if(names[x] == "Joe Smith")
Keep a running total: sum+=studentGrades[x];