Question: Using JavaScript extend the function play to call the function randomSelection( ); this function returns a string representing the hand sign name (i.e., paper, rock,
Using JavaScript extend the function play to call the function randomSelection( ); this function returns a string representing the hand sign name (i.e., paper, rock, or scissors.) After selecting the computers hand sign, play must call the function whoWins(human, computer); this function takes as arguments two strings that represent the hand signs chosen by the human and computer, respectively, and returns the identifier of the winner. whoWins returns human, computer, or draw. whoWins must call the Boolean function beats(A, B), where A and B are selections (i.e., paper, rock, or scissors.) beats(A, B), returns true if A beats B, and false otherwise. Create play, and whoWins using JS
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
