w3schools: Functions w3schools: For Loops Download: Exercise 1 files
Functions are the bread and butter of JavaScript programming. A function is a block of code that will perform a particular task. A function is executed when "something" calls it.
The concept of wrapping a piece of code in a value has many uses. It gives us a way to structure larger programs, to reduce repetition, to associate names with subprograms, and to isolate these subprograms from each other.
For Loops can execute a block of code a number of times. They are a great way to work with arrays of data!