A recursive function is one that calls itself ๐. In this assignment you will use recursion to solve three problems.
In this assignment you will use JavaScript and recursion to:
- create possible hands ๐ for Rock, Paper, Scissors.
- traverse the DOM and get elements by their class name.
- turn JavaScript values into JSON strings.
- Fork ๐ด and clone this repository following the Code Chrysalis git flow instructions.
- Open the
index.html
file in your browser. You will see a list of failing tests. - Commit your work often.
- When you have completed all the tasks, follow the Code Chrysalis git flow instructions to create a
pull request
.
Write code in the src/rockPaperScissors.js
, src/getElementByClassName.js
, and src/stringifyJSON.js
files to make the tests pass.
-
rockPaperScissors
: ๐ค ๐ โ๏ธ Generate permutations of the game Rock, Paper, Scissors. -
getElementByClassName
: A practical instance of recursion. The DOM is a ๐ณ tree structure and recursion is an efficient way to traverse it.- See links provided in Resources for some help
-
stringifyJSON
: Also a very practical use of recursion. We will be recreating theJSON.stringify
method, which converts a JavaScript value to a JSON string.
- Watch Fun Fun Function's Recursion video
- Useful for
getElementsByClassName