First URL: https://megler.github.io/tik-tak-toe-3/ttt4.html
Second URL: https://megler.github.io/tik-tak-toe-3/ttt5.html
Answer to Question: The checkForWinner()
method really took some thinking. The original map wasn't too hard, but thinking through the array of 8 strings was a challenge. I was excited when I figured out a way to use what was in this week's lecture (join
) and put it to work in an array. As noted in my inline comments, I could have used find
and include
to make that function more concise, but since we hadn't covered it, I opted to stick with for loops. This is a bit of a departure from how I write Angular code, so it was a lot of fun. JS has so much to offer, it's a really fun language!