How can I write a neater set of code for my rock paper scissors game?
问题 Below is my JS file for a rock, paper, scissors game activity we had to do in my web development class. I was able to get everything to work, however I do not like how long my if-else statements made my code and was wondering how can I make this more concise and have it in less lines of code. const imagePath=[]; imagePath.push("img/paper.png"); imagePath.push("img/rock.png"); imagePath.push("img/scissors.png"); let counter=1; let counter2=1; let images=document.querySelector("#player"); let