The hint for step 12 (create the function playGame()
) is
const playGame = () => { const userChoice = getUserChoice('scissors'); const computerChoice = getComputerChoice();
I wondered why we don’t have to write const playGame = (userChoice, computerChoice) =>
. Is it because we will declare the parameters later inside the function block?
Then if we choose to declare first, I figured out we can write the above code block as below:
const playGame = (userChoice, computerChoice) => { userChoice = getUserChoice('scissors'); computerChoice = getComputerChoice();
This post is to ask if my understanding is correct!