Happy Coding

Using the DOT instances

I am learning about classes, and would like to know what the length parameter means when used in the following script.
“circles.length” It is used in this loop
for (let i = 0; i < circle.length; i++){
let c = circles[]
c.y++
circle(c.x,c.y,25);
}

Out of curiosity where did you find that code? Looks like it has a couple of typos!

My guess is that the for loop is meant to reference a variable called circles which is probably an array. Arrays hold multiple values, and the length property tells you how many values are in an array.

You can learn more about arrays here: