xxxxxxxxxx
19
let foo; // this is a global variable, visible in all functions
function setup() {
foo = 7;
}
function draw() {
print(foo);
let bar; // this is a local variable, visible only inside of draw()
for (let i = 0; i < width/2; i++) {
// i is a local variable visible only inside this for() loop
ellipse(i, height/2, 10,15);
}
print (i);
}