I’m in the middle of the Chore Door project and I’ve hit a wall. Before adding the random door generator, everything functions - after adding it, it no longer works. I must have made a mistake between step 37 and 44 but I can’t find it. If anyone has any insight I’d appreciate it! The problematic code is pasted below.
const numClosedDoors = 3;
let openDoor1 =;
let openDoor2 =;
let openDoor3 =;
const randomChoreDoorGenerator = () => {
let choreDoor = Math.floor(Math.random() * numClosedDoors);
if (choreDoor === 0) {
openDoor1 = botDoorPath;
openDoor2 = beachDoorPath;
openDoor3 = spaceDoorPath;
} else if (choreDoor === 1) {
openDoor2 = botDoorPath;
openDoor1 = beachDoorPath;
openDoor3 = spaceDoorPath;
} else {
openDoor3 = botDoorPath;
openDoor1 = beachDoorPath;
openDoor2 = spaceDoorPath;
};
};
door1.onclick = () => {
doorImage1.src = openDoor1;
};
door2.onclick = () => {
doorImage2.src = openDoor2;
};
door3.onclick = () => {
doorImage3.src = openDoor3;
};
randomChoreDoorGenerator();