I had trouble pushing my git branch, so I had to push it without branching. After attempting to make this game many times I decided to study the solution and finally understood how it's done. However, I don't understand why "this" needs to be used on line 28 (typing in my variable "square" instead of "this" prevents the game from working). I figured that maybe it only works when I type "this" because the variable "square" is inside of an anonymous function.
I also attempted to do the bonus question but had too much getting the brushes to change color according to the input.
Inside event listener functions, this always refers to the element that was clicked on. If you already have that element saved to a variable, you can use that variable instead: either is fine.
I had trouble pushing my git branch, so I had to push it without branching. After attempting to make this game many times I decided to study the solution and finally understood how it's done. However, I don't understand why "this" needs to be used on line 28 (typing in my variable "square" instead of "this" prevents the game from working). I figured that maybe it only works when I type "this" because the variable "square" is inside of an anonymous function.
I also attempted to do the bonus question but had too much getting the brushes to change color according to the input.