Cube Matcher - Confused about fixing this game

https://www.codecademy.com/paths/create-video-games-with-phaser/tracks/game-dev-learn-javascript-higher-order-functions-and-iterators/modules/game-dev-project-iterators/projects/cube-matcher

I’ve done steps 1 and 2. They are quite easy as they require you to just locate things. I’m completely stuck on step 3. I have no idea what to code. Can someone help me out?