# Rock, Paper, Scissors : Frontend Coding Exercise

**URL:** <https://forum.kirupa.com/t/rock-paper-scissors-frontend-coding-exercise/683593>\
**Category:** programming\
**Created:** [October 6, 2026, 8:31pm UTC](https://forum.kirupa.com/t/rock-paper-scissors-frontend-coding-exercise/683593 "2026-10-06T20:31:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [October 6, 2026, 8:31pm UTC](https://forum.kirupa.com/t/rock-paper-scissors-frontend-coding-exercise/683593/1 "2026-10-06T20:31:49Z")

</div>

This is where you can share your code for solving the [Rock, Paper, Scissors](https://www.kirupa.com/codingexercises/rock_paper_scissors.htm) exercise 🙂

---

<div class="post-metadata">

**Author:** ![HariSeldon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hariseldon/32/31261_2.png) [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)\
**Post date:** [October 6, 2026, 11:40pm UTC](https://forum.kirupa.com/t/rock-paper-scissors-frontend-coding-exercise/683593/2 "2026-10-06T23:40:23Z")

</div>

It’s interesting how a simple game like Rock, Paper, Scissors can quickly expose the complexities of state. My students always get tripped up on managing scores and choices across rounds. The choices are straightforward, but keeping track of who picked what, and then updating scores reliably, often leads to some tangled logic.

```auto
// A simplified example of the state they often struggle with
let playerScore = 0;
let computerScore = 0;
let playerChoice = ''; // 'rock', 'paper', or 'scissors'
let computerChoice = '';

```
