lamberta/html5-animation — Issue #1: Ch 8, Ex 11: Balls in front of lines? 
Author: lamberta
Created: 2012-03-06 23:03:46+00:00
State: open

*[This question was sent to me via email, excerpts reposted here with permission.]*

I have been playing with the code below [[Chapter 8, Example 11]](https://github.com/lamberta/html5-animation/blob/master/examples/ch08/11-chain-array.html) ... When the canvas renders the lines, they're on top of the balls, but in the example before (where an array is not used) the balls are drawn on top. I was trying to figure out how to draw the line underneath like the first example. Going through the code I am not sure where `ballB` gets defined. `var ballA = balls[i-1];` defines `ballA` but how is `ballB` defined? Is it a key from the array? And if so why is `ballA` defined?
Thank you!
Peter