Chore Door Project - Almost got it, but buggy

Hi,

I am working on the Chore door project. I am stuck with the doors closing out every time I click a door. Here is the code - https://gist.github.com/f7968de7ecc294f7d8b49d783ae5ffd8

Somewhere I feel that the startOver() function call in the end is misplaced. It seems to be called every time there is an event rather than only when the page is loaded. Although in instructions and the video shows that it should be there.

The code worked till I coded for startButton.onclick function. Then it got a little messy.

Please help

Best Wishes
Trishna

door1.onclick = () => {
  startRound();

There’s your culprit. That function call should not be inside the event handler for any doors.