In this video we refactor our Rock, Paper, Scissors code two times. We take our first version and refactor it with a loop and an array. Then, we continue refactoring code by updating the entire application to a functional approach.
✅ Quick Concepts outline:
Refactoring Code: Rock, Paper, Scissors
• Comparing version 1 and version 2
• Adding a loop
• Adding an array
• Eliminating the reload
• Testing our code
• Comparing version 2 and version 3
• A functional approach
📺 Here’s the refactored code for each version:
Gist for Rock, Paper, Scissors version 1:
https://gist.github.com/gitdagray/38322a7141f4236e050086e7053febb7
Gist for Rock, Paper, Scissors version 2 (add loop and array):
https://gist.github.com/gitdagray/a709dba6c46fcd2b239a8a5679af4e0e
Gist for Rock, Paper, Scissors version 3 (with functions):
https://gist.github.com/gitdagray/c33ef93ba4c18aa3d123c26be23d539a
#javascript #web-development #programming #developer