Apologies if my title isn't clear, I'm struggling to figure out the next steps here.
I've been teaching myself JavaScript.
Right now, I'm working on creating a tic-tac-toe game.
I'm using only vanilla Javascript and lodash for this project.
The board is currently stored as an array and split into 3 rows using lodash.chunk:
For example:
array = [
[x,x,x],
[x,o,x],
[o,o,x],
]
I've managed to determine a winner in the same row, but now I'm stuck on how to check for diagonal or up/down wins.
I just can't seem to visualize what needs to be done next.
If anyone can guide me on how to achieve this using best practices, I would greatly appreciate it.
Thank you!