Skip to content
Snippets Groups Projects
Commit 8bc199e7 authored by Subliminal Guy's avatar Subliminal Guy
Browse files

Bug Fix Arrow Function

parent 2f01457e
No related branches found
No related tags found
No related merge requests found
...@@ -9,9 +9,9 @@ const roundResultsMessage = document.getElementById("results-msg") ...@@ -9,9 +9,9 @@ const roundResultsMessage = document.getElementById("results-msg")
const buttonStein = document.getElementById("rock-btn") const buttonStein = document.getElementById("rock-btn")
const buttonPapier = document.getElementById("paper-btn") const buttonPapier = document.getElementById("paper-btn")
const buttonSchere = document.getElementById("scissors-btn") const buttonSchere = document.getElementById("scissors-btn")
buttonStein.addEventListener("click", showResults("Stein")); buttonStein.addEventListener("click", () => showResults("Stein"));
buttonPapier.addEventListener("click", showResults("Papier")); buttonPapier.addEventListener("click", () => showResults("Papier"));
buttonSchere.addEventListener("click", showResults("Schere")); buttonSchere.addEventListener("click", () => showResults("Schere"));
function getRandomComputerResult(){ function getRandomComputerResult(){
...@@ -43,6 +43,7 @@ function getRoundResults(playerChoice){ ...@@ -43,6 +43,7 @@ function getRoundResults(playerChoice){
} }
function showResults(playerChoice) { function showResults(playerChoice) {
console.log("click")
roundResultsMessage.innerText = getRoundResults(playerChoice) roundResultsMessage.innerText = getRoundResults(playerChoice)
playerScoreElement.innerText = playerScore; playerScoreElement.innerText = playerScore;
computerScoreElement.innerText = computerScore; computerScoreElement.innerText = computerScore;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment