JavaScript performs several types of repetitive operations, called "looping". Loops are set of instructions used to repeat the same block of code till a specified condition returns false or true depending on how you need it. This tutorial shows the basic idea on how to use loops in JavaScript.
Learn to use objects to speed up the execution of your script. Can make the script a lot smaller and a lot more organized. This is the object oriented side of JavaScript.