In my RPS game there is a function call playGame() which will play the game until the score reaches 5 on click event. So the problem is when it reaches 5 it is not immediately firing the second function which is getWinner(). But it is waiting the button to be clicked. Is there any method which will execute the getWinner() as soon as the score hits 5.
My knowledge in js is basic so please help me out.