width and height for canvas sizewindowWidth and windowHeight for screen sizemouseX and mouseY to get mouse positionFor Loops
Use this to generate many items on a page
for (let x = 0; x <= width; x += 50) {
fill(255, 0, 200);
ellipse(x, 300, 25, 25);
}
If statements
Use this when you want to create different choices or dependencies
let diceRoll = Math.round(random(1, 6));
if (x < 3){
console.log('low roll sorry')
} else {
console.log('wow lucky roll')
}
Store items in variables
let x = 5;
If you want to store many variables, or many values, you can use data structures like arrays
let valueArray = [1, 5, 6, 7, 8];
let x = 5, y = 3, z = 10;
let secondArray = [x, y, z]