Please try to only declare variables in scoped blocks. The body of the for-loop isn't scoped.  Put `var strokeDash;` either in L12 or L16.