Chore Door / Chore Bot , step 40

Step 40 states that:
First, create the global variables openDoor1 , openDoor2 , and openDoor3 but do not assign any value to them globally. They’ll be assigned values within your randomChoreDoorGenerator() function.

But it’s not valid to create const without assigning a value according to what I’ve read:

JavaScript const variables must be assigned a value when they are declared

Well, seeing that they will be assigned values by the randomChoreDoorGenerator() tells you what type of variable to use. Certainly not const since they cannot be reassigned.

So what type should you use?

Ah right! I’ll use let then. Looked too much into previous steps where it was const all the way up until now. :laughing:

1 Like

Glad I could help. Just teach yourself to with each variable think about what its application is and adjust the type accordingly.

Happy coding!

1 Like