Next we will need to reset all of the dig spots. We can repeat code on each element of an array easily using a for… of loop. This is a shortcut version of a classic for loop that works especially well for this purpose.

- In the TreasureControllerScript, find the randomizeTreasure function, and create a for loop using the keyword for, ( ) parentheses, and { } curly brackets. This should look a lot like an if-statement or a function.
- Between the ( ) parentheses, create a new variable called spot with let, and use the keyword of to say that it will be each of the elements of the digSpots array.
- In a new line between the { } curly brackets, send the event “setHasTreasure” with the value false to the spot variable.
- Finally, call the randomizeTreasure function at the end of your resetGame function.