This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modified the ordering of these moves so we can do an easier comparison later. | |
// selectMove sounds more of a verb like a function doing something, so renaming | |
// to "moves" to signify it is a collection/array of move. | |
const moves = ["Rock", "Scissors", "Paper"]; | |
let playerScore = 0; | |
let computerScore = 0; | |
// Using getComputerSelection() instead of computerPlay() | |
// lets us know that we will indeed GET something from it, | |
// ie. the function will return something. |