This sketch simply shows how you can use loops in js.
HTML5 Canvas demos by mFragin Licence info here.