**Chore door** What is wrong with my code!

Hi, I am on the chore door project, task 46. As far as I can see my code looks correct and matches the help video but I when I am selecting the doors, I am supposed to see one of each type (beach, space, bot). Instead I am being shown 2 of 1 type and none of another (see screenshot). I have been racking my brains and I can’t find anything that could be doing this in my code, please help!

let doorImage1 = document.getElementById('door1');
let doorImage2 = document.getElementById('door2');
let doorImage3 = document.getElementById('door3')

let beachDoorPath = "https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/beach.svg";
let spaceDoorPath = "https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/space.svg"
let botDoorPath = "https://s3.amazonaws.com/codecademy-content/projects/chore-door/images/robot.svg";
let numClosedDoors = 3;
let openDoor1;
let openDoor2;
let openDoor3;



const randomChoreDoorGenerator = () => {
let choreDoor = Math.floor(Math.random() * numClosedDoors);
if (choreDoor === 0){
  openDoor1 = botDoorPath;
  openDoor2 = spaceDoorPath;
  openDoor3 = beachDoorPath;
}else if (choreDoor === 1){
  openDoor2 = botDoorPath;
  openDoor1 = spaceDoorPath;
  openDoor3 = beachDoorPath;
}else {
  openDoor3 = botDoorPath;
  openDoor1 = spaceDoorPath;
  openDoor2 = beachDoorPath
}
}


door1.onclick = () => {
  doorImage1.src = openDoor1;
}
door2.onclick = () => {
  doorImage2.src = openDoor2;
}
door3.onclick = () => {
  doorImage3.src = openDoor2;
}
randomChoreDoorGenerator();
 

Realised there’s 2 instead of a 3 , god that was frustrating :rofl:

1 Like

Yep, thats it. Eventually you find out yourself.

Happy coding!