Now that we can designate a treasure spot ourselves, let’s have the program pick one at random for us, so that we don’t know which one it is going to be. To do this, we will need to generate a random number using the Math library.

- In the randomizeTreasure function, delete the existing console.log.
- Create a new variable with let called numSpots, and set it to the number of elements in the digSpots array with digSpots.length.
- Create a new variable called randomNumber, and set it to Math.random(), which will give you a decimal number between 0 and 1.
- In a console.log, multiply these together.
- Open the Dev Tools console and see what values you get each time you press the Play button.
