Hi i don’t know why this code runs well in the p5js reference but not in my web editor could you help me please?
let value = 0;
function draw() {
fill(value);
rect(25, 25, 50, 50);
describe(black rect center. turns white when left arrow pressed and black when right.
);
}
function keyPressed() {
if (keyCode === LEFT_ARROW) {
value = 255;
} else if (keyCode === RIGHT_ARROW) {
value = 0;
}
}