DEV Community

Discussion on: Rock Paper Scissors in React vs JavaScript (video)

Collapse
 
theccode profile image
Eric A. Kumah • Edited

Hi Ania, I tried to improve upon your code by converting the switch statement to an object. That has led to a much concise length of code plus the flexibility of being able to make changes to the object and the core logic for determining a win, lose, or a draw infinitely easier...

Collapse
 
ania_kubow profile image
Ania Kubow

Thanks for sharing this Eric! I can't watch the video as its private :(

Collapse
 
theccode profile image
Eric A. Kumah

Sorry, I just realized I didn't publish it, and actually this is the first youtube video I've ever made. Please let me know what you think about the code, I'm wildly optimistic about having met the requirement of the paper_scissors_rock game.

Thread Thread
 
ania_kubow profile image
Ania Kubow

Oh wow I LOVE that approach!! So cool to see how you have taken the game and applied your own style of coding to it. Very professional :)

Thread Thread
 
theccode profile image
Eric A. Kumah

Thanks :)