Treasure Hunter Scoring problem

I’m having trouble with step 22 in the Treasure Hunter game dev project, which is somewhat unclear as to how to proceed:
22. If our condition was truthy, then the player selected a plot with a gold coin! Inside the if statement:

  • Give the player some points by incrementing playerCoins
  • Change the clicked plot’s sprite to use the 'playerGold' image with the following Phaser syntax:


  • And finally, add a break statement to end the loop.
    This is my attempt at step 22 in the project:
    function playerCheck() {

    for (let i = 0; i < coinCollection.length; i++) {
      if (clickedPlot === coinCollection[i]) {
        playerCoins += 1;
      } else {

If you could give me some suggestions, or have a working snippet of code that I can study, please share it as soon as you can. Thanks in advance!
Here’s the full code if you want to take a look: