Chore Bot Challenge... button script not changing

https://www.codecademy.com/projects/practice/chore-door

let doorImage1 = document.getElementById("door1");

let doorImage2 = document.getElementById("door2");

let doorImage3 = document.getElementById("door3");

let botDoorPath = "https://content.codecademy.com/projects/chore-door/images/robot.svg";

const beachDoorPath = "https://content.codecademy.com/projects/chore-door/images/beach.svg";

const spaceDoorPath = "https://content.codecademy.com/projects/chore-door/images/space.svg";

const numClosedDoors = 3;

let openDoor1 ;

let openDoor2 ;

let openDoor3 ;

const closedDoorPath = "https://content.codecademy.com/projects/chore-door/images/closed_door.svg";

const startButton = document.getElementById("start");

const isClicked = door => {

  if (door.src === closedDoorPath) {

    return false;

  } else {

    return true;

  }

}

const playDoor = () => {

  numClosedDoors--;

  if (numClosedDoors === 0) {

    gameOver('win');

  }

}

doorImage1.onclick = () => {

  if(!isClicked(doorImage1)) {

    doorImage1.src = openDoor1;

    playDoor();

  } 

}

doorImage2.onclick = () => {

  if(!isClicked(doorImage2)) {

    doorImage2.src = openDoor2;

    playDoor();

  }

}

doorImage3.onclick = () => {

  if(!isClicked(doorImage3)) {

    doorImage3.src = openDoor3;

    playDoor();

  }

}

const gameOver = (status) => {

  if (status === 'win') {

    startButton.innerHTML = 'You win! Play again?';

  }

}

gameOver();

const randomChoreDoorGenerator = () => {

  let choreDoor = Math.floor(Math.random() * numClosedDoors);

  if (choreDoor === 0) {

    openDoor1 = botDoorPath;

    openDoor2 = beachDoorPath;

    openDoor3 = spaceDoorPath;

  } else if (choreDoor === 1) {

    openDoor2 = botDoorPath;

    openDoor3 = beachDoorPath;

    openDoor1 = spaceDoorPath;

  } else if (choreDoor === 2){

    openDoor3 = botDoorPath;

    openDoor1 = beachDoorPath;

    openDoor2 = spaceDoorPath;

  }

}

randomChoreDoorGenerator();

I can’t find the problem. The script in the button is supposed to change when you open three doors. Mine does not. I cannot find the problem in my code. Can anyone help me?

I found one problem:

That should be

let numClosedDoors = 3;

because you want the number of closed doors to be able to change. (Otherwise there’s an error if you try to change a const variable.)

I recommend using the browser’s console to check for errors in this project. (The console is usually in the Developer tools.)

Thank you! That fixed the problem. Next question… if you can help. I still struggle with let vs const. Why would I not just use let always to avoid what just happened?

const is useful for keeping track of things you don’t want to change or reassign.
That way, if the code tries to change something it shouldn’t, you can find where the problem is - from the error.
(Yes, errors can be a good thing too … they makes sure your code doesn’t do something you don’t want it to do.)