xxxxxxxxxx
16
let x = 20;
let msg = "hello world"; // defines variable
let emptyMsg; // declares variable to be used later on
function setup() {
createCanvas(400, 400);
// print (x);
let msg = "in setup"; // will overwrite the global one if you redefine it in a function, this definition wont apply to the function draw section, the global scope will apply to the function draw section (unless you redefine in the function draw section)
print(msg);
}
function draw() {
background(220);
}