When you get to the end of a playlist, it usually loops.
JavaScript:
for (i=1; i++; i<=10){
document.write(i)
}
php:
for ($i=0; i<101;i++){
print(i)
}
lua:
for i=0, 100 do
print(i)
end
You can use arrays and lists to get through numbered lists/variables.
Arrays
- A box of 12 crayons - "Get the first one from the right."
- An order of family members.
- "Hash" = an associative array
for (i=1; i++; i<=10){
document.write(i)
}
var myFamily={"John", "Kimball", "Karen", "Kathryn", "Jana", "Sara", "Kristen"}
alert{myFamily[5]};
Modularizing in your code helps you iterate through your arrays.
No comments:
Post a Comment