computerPlaythat will randomly return either 'Rock', 'Paper' or 'Scissors'. We'll use this function in the game to make the computer's play. Tip: use the console to make sure this is returning the expected output before moving to the next step!
computerSelection- and then return a string that declares the winner of the round like so:
"You Lose! Paper beats Rock"1. Make your function's playerSelection parameter case-insensitive (so users can input
RocKor any other variation).
returnthe results of this function call, not
console.log()them. To test this function console.log the results:
game(). Use the previous function inside of this one to play a 5 round game that keeps score and reports a winner or loser at the end.
playRoundfunction 5 times in a row. Loops are covered in the next lesson.
console.log()to display the results of each round and the winner at the end.